Re: [Matplotlib-users] Basemap help, imshow, transform_scaler

2007-11-01 Thread Eric Firing

John,

Attached is a script illustrating how to make contourf plots with a log 
colorscale.  I made some improvements in svn, as noted in the script, 
but you can still do it with the regular mpl release.  All of this 
should carry through to basemap with no changes in basemap.


Eric

John wrote:
Well, it seems like I'm making progress, but it's stll not the plot I'm 
hoping to produce. Something seems strange. First, it does create a 
contourf plot, but I really need to take log(zdata) and use imshow 
(which seems to handly the INF issue, wheras contourf crashes). On 
another issue though, once the image is created, when I draw the map 
components it covers the image entirely.. so I just see coastlines, 
meridians, etc on a whilte background as if I had never plotted the data.
 
Thanks for helping with this! I'm really trying to make a movement with 
my colleagues away from matlab, but I need to have things operating more 
smoothly... lately it hasn't been going so well. This is a great product 
you've made!





-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/




___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


'''
Demonstrate use of a log color scale in contourf
'''

import pylab as P # or from matplotlib import pyplot as P if you are using svn
import numpy
from numpy import ma
from matplotlib import colors
from matplotlib import ticker

z = numpy.arange(1, dtype=float)
z.shape = 100,100

z = numpy.power(10, 5*z/z.max())

# Put in some negative values to cause trouble with logs:
z[:5, :5] = -1

# The svn version will do the following automatically, and
# print a warning; but with the released mpl you must do it
# yourself.
z = ma.masked_where(z= 0, z)


lev_exp = numpy.arange(0, numpy.log10(z.max())+1)
print z.max(), z.min()
print lev_exp
levs = numpy.power(10, lev_exp)

# With svn, automatic selection of levels works; setting the
# locator tells contourf to use a log scale:
#cs = P.contourf(z, locator=ticker.LogLocator())

# but with the current mpl release, you must carefully
# set the levels yourself, and set the norm like this:
cs = P.contourf(z, levs, norm=colors.LogNorm())

# Of course the form above still works in svn also.

#The 'extend' kwarg, however, does not work yet with a log
#scale either in the release or in svn.

cbar = P.colorbar()

P.show()


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDL Font question

2007-11-01 Thread Gary Ruben
IDL uses the Hershey vector fonts
http://www.ifi.uio.no/it/latex-links/STORE/opt/rsi/idl/help/online_help/Hershey_Vector_Font_Samples.html

The problem is that these are not trutype fonts, so the easiest solution 
is probably to find some free sans-serif font that looks close to 
Hershey on a free font site.

HTH,
Gary R.

Jose Gomez-Dans wrote:
 Hi,
 Some colleagues have sent some plots which they generated using IDL
 (boo!!! hiss!! :D), and they look quite dissimilar to my matplotlib
 ones. I would like to mimic their layout as much as possible, which so
 far is a success. The only problem is that I don't know what font to
 use. In IDL, I believe it is called Roman (there's an smudged
 example here: http://www.astro.ufl.edu/~warner/IDL5220/HW4w.jpg).
 Does anyone know a suitable alternative?
 
 Thanks!
 Jose

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDL Font question

2007-11-01 Thread Angus McMorland
On 01/11/2007, Jose Gomez-Dans [EMAIL PROTECTED] wrote:
 Hi,
 Some colleagues have sent some plots which they generated using IDL
 (boo!!! hiss!! :D), and they look quite dissimilar to my matplotlib
 ones. I would like to mimic their layout as much as possible, which so
 far is a success. The only problem is that I don't know what font to
 use. In IDL, I believe it is called Roman (there's an smudged
 example here: http://www.astro.ufl.edu/~warner/IDL5220/HW4w.jpg).
 Does anyone know a suitable alternative?

Not quite the answer you were looking for, but a completely different
approach, if you can ask them to resend the data, is to get them to
save out a postscript file, which IDL can do. Then you can edit the
components with a tool like inkscape and standardise the fonts across
all graphs.

Angus.
-- 
AJC McMorland, PhD Student
Physiology, University of Auckland

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Rose plot example?

2007-11-01 Thread Alan G Isaac
URL:http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg01221.html

hth,
Alan Isaac




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap help, imshow, transform_scaler

2007-11-01 Thread John
Thanks Eric...

Just a question, I've noticed that if I put enough resolution in lev_exp
(ie. lev_exp=arange(0,log10(z.max()),0.15)  #or more is even nicer! Then the
file size gets quite large due to all the colors. Any suggestions? I know
its a separate issue...

-john
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDL Font question

2007-11-01 Thread Andrew McLean
It depends exacly what you need, but this might help:

Ghostscript comes with the Hershey fonts. You should be able to choose 
an appropriate font name in Matplotlib, e.g. Hershey-Gothic-English, and 
produce a Postscript file using an appropriate backend. You should then 
be able to convert that to one of any number of formats (bitmaps and 
PDF) using Ghostscript. Note the use of the word should, I haven't tried 
this myself!

- Andrew

Gary Ruben wrote:
 IDL uses the Hershey vector fonts
 http://www.ifi.uio.no/it/latex-links/STORE/opt/rsi/idl/help/online_help/Hershey_Vector_Font_Samples.html

 The problem is that these are not trutype fonts, so the easiest solution 
 is probably to find some free sans-serif font that looks close to 
 Hershey on a free font site.

 HTH,
 Gary R.

 Jose Gomez-Dans wrote:
   
 Hi,
 Some colleagues have sent some plots which they generated using IDL
 (boo!!! hiss!! :D), and they look quite dissimilar to my matplotlib
 ones. I would like to mimic their layout as much as possible, which so
 far is a success. The only problem is that I don't know what font to
 use. In IDL, I believe it is called Roman (there's an smudged
 example here: http://www.astro.ufl.edu/~warner/IDL5220/HW4w.jpg).
 Does anyone know a suitable alternative?

 Thanks!
 Jose
 


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap help, imshow, transform_scaler

2007-11-01 Thread John
The default, TkAgg. I've tried the others as I have some strange behavior
with TkAgg, but they don't work at all... In fact, I think I'll start
another thread, because the problem I have is now predictable... I would be
interested to see if there's a solution...
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] TkAgg freezing, problems with backend

2007-11-01 Thread John
I have strange behavior when using TkAgg on a script which produces plots
repeatedly. On the first instance of the plotting, the Figure window is not
interactive, and needs to be 'killed' by clicking the x in the top right
(this is on XP, by the way). On subsequent calls, it seems fine.

What's is strange is when I run it in a debugging environment such as Wing
or otherwise, after it's 'killed' the first time I can use close() to close
it, but not on the first instance. Could this be related to not using the
figure() command? I usually just call with functions like plot(x) or
imshow(x) or contour(x) etc...
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Rose plot example?

2007-11-01 Thread Jed Frechette
On Thu, 1 Nov 2007
Alan G Isaac [EMAIL PROTECTED] wrote:
 URL:http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg01221.html

hth,

Ah, I sould be able to modify that to do what I need but it's to bad
there isn't a more elegant way than remaping the data and faking the
labels.

Thanks for the quick help.

-- 
Jed Frechette
jdfrechette.alturl.com

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users