Re: [Matplotlib-users] countour plot custom labels

2009-12-02 Thread Jae-Joon Lee
This would only meaningful if you set contour levels manually.

plt.figure()
levels = [-1, 0, 1]
fmt = {-1.:"-1",
   0.:"0",
   1.:"+1"}
CS = plt.contour(X, Y, Z, levels)
plt.clabel(CS, inline=1, fontsize=10, fmt=fmt)

Regards,

-JJ


On Wed, Dec 2, 2009 at 6:32 AM, Momme Butenschön  wrote:
> in the help for the countour plot labeling it says:
>   *fmt*:
>     a format string for the label. Default is '%1.3f'
>     Alternatively, this can be a dictionary matching contour
>     levels with arbitrary strings to use for each contour level
>     (i.e., fmt[level]=string)
> can somebody enlighten me how this works?
> how do I connect levels to what dictionary keyword?
>
> thank a lot,
> Momme
>
>
> --
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Extending patches.Rectangle class

2009-12-02 Thread Jae-Joon Lee
On Tue, Dec 1, 2009 at 8:48 AM, Jorge Scandaliaris
 wrote:
> How difficult would be to extend the Rectangle class so besides its permimeter
> it draws lines showing halfs or thirds of the width and height?

It depends on your mileage.

However, a patch in matplotlib usually means a closed path. If you add
additional lines, you need to be careful not to mess the filling of
the rectangle.

I guess it would better to simply use separate artists for additional
lines you want. You may create a container artist for patches and
lines if you want.

Regards,

-JJ

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] AxesGrid problem.

2009-12-02 Thread Jae-Joon Lee
This happens because, when the AxesGrid is created, gca() is set to the last
axes, which is the last colobar axes.

If you use axes_grid toolkit, you'd better not use pyplot command that works
on axes. Instead, use axes method directly.

For example, instead of  "pyplot.pcolor(..)" , use "ax.pcolor(..)".

Regards,

-JJ




On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve  wrote:

> Hello,
>
> I'm trying to use AxesGrid but I'm running into a problem:
> I can plot a single pcolor plot:
> [image: 58dFK.png]
> But when I try to use AxesGrid, my pcolor plot is ending up where I expect
> my colorbar to be.
> [image: mEbTA.png]
>
> I want to have up to 6 of these plots stacked vertically, sharing a common
> time axis and y (depth) scale.
>
> I'll try to simplify my code to show what I'm doing:
>
> # I have arrays x_grid and y_grid for time and water depth.
> # z_dim is a dictionary of arrays (one for each plot)
> # In the plot above it has two arrays.
> from matplotlib import pyplot
> nrows = len(z_dim) # Number of rows is the number of arrays
> My_figure = pyplot.figure(1,(8,8))
> my_grid = AxesGrid(My_figure, 111, #Is this always 111?
> nrows_ncols = (nrows,1), # Always one column
> axes_pad = 0.1,
> add_all=True,
> share_all=True, # They all share the same time and depth
> scales
> label_mode = "L",
> cbar_location="right",
> cbar_mode="each",
> cbar_size="7%",
> cbar_pad="2%",
> )
> for row_no,parameter in enumerate(z_dim):
> ax = my_grid[row_no]
> ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
> pyplot.draw()
> pyplot.show()
>
> I eventually want to end up with something like this matlab output (which I
> didn't generate):
> [image: jiIaK.png]
> but without the duplication of x scales.
>
> I'm new to pyplot and even after reading the documentation much of this is
> baffling.
>
> -Ryan
>
>
>
> --
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] adjusting space between axes label and axes

2009-12-02 Thread Jae-Joon Lee
On Sun, Nov 22, 2009 at 11:16 AM, per freem  wrote:
> is there an existing parameter that just controls the distance between
> the xticks and the label?

As you first tried (with your example with axes_grid), labelpad
parameter does what you want.

plt.xlabel("xlabel", labelpad=0)

or

ax.xaxis.labelpad = 0

It didn't work in your previous example because you were using
axes_grid toolkit, that simply ignores this parameter.

Also, see this

http://matplotlib.sourceforge.net/faq/howto_faq.html#align-my-ylabels-across-multiple-subplots


Regards,

-JJ

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread Christopher Barker
Christopher Barker wrote:

> The diskimage is usually built for the python binary supplied by 
> python.org -- that is what the message means by the "system version". I 
> tried to submit a patch to change that message a year or two ago, but I 
> guess it never got applied -- maybe I'll try again.

I took a look at the source for the latest bdist_mpkg -- it looks like 
it should now give a message like:

"This package requires MacPython to be installed"

though It's all a bit complicated -- did whoever built the dmg use the 
latest bdist_mpkg?

But maybe should still do:

> A note to developers/distributors:
> 
> Robin Dunn figured out a way to install a binary wxPython that will work 
> with both the Apple and the python.org binaries. What it does it put it 
> in /usr/local, and then put a pth file in both of the pythons so that it 
> can be found. A bit of a hack, but it works, and I've never heard anyone 
> have a problem with it.
> 
> Perhaps we should do the same thing with MPL -- I'm sure he'd be glad to 
> share his scripts for building it.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread Christopher Barker
Lisa M Winter wrote:
> 1) The diskimage installation: When I open the installer, I am told  
> that I can not install matplotlib on my disk because I do not have a  
> system version of python 2.6.  I do not understand this error since I  
> am running the default version (which is 2.6.1).

The diskimage is usually built for the python binary supplied by 
python.org -- that is what the message means by the "system version". I 
tried to submit a patch to change that message a year or two ago, but I 
guess it never got applied -- maybe I'll try again.

A note to developers/distributors:

Robin Dunn figured out a way to install a binary wxPython that will work 
with both the Apple and the python.org binaries. What it does it put it 
in /usr/local, and then put a pth file in both of the pythons so that it 
can be found. A bit of a hack, but it works, and I've never heard anyone 
have a problem with it.

Perhaps we should do the same thing with MPL -- I'm sure he'd be glad to 
share his scripts for building it.


-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread William Carithers
You're right--that's pretty simple. I ran that exact code and it worked
fine.

Don't know what to say except that this is above my competence level to dig
into the guts of tk. Looks like a problem for John Hunter.

Sorry I couldn't help more,
Bill


On 12/2/09 2:49 PM, "Lisa M Winter"  wrote:

> from pylab import *
> plot([1,2,3])
> show()



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread Lisa M Winter
Sure.  This is all that it is:

from pylab import *
plot([1,2,3])
show()


On Dec 2, 2009, at 3:42 PM, William Carithers wrote:

> Hi Lisa,
>
> Hmm. I also use TKAgg with no problems. Looking at your code, it  
> looks like
> you are trying the first example in the tutorial. Just to be sure,  
> could you
> post/send a full listing of your simple_plot.py?
>
> Thanks,
> Bill
>
> On 12/2/09 2:01 PM, "Lisa M Winter"  wrote:
>
>> Thanks for the pointers, Bill.
>>
>> I tried installing from source as you suggested, but I am getting the
>> same errors when I try to plot.  What backend are you using?
>>
>> Here is what I get when I try using TkAgg:
>>
>> casa98-125-dhcp:.matplotlib lisa$ python simple_plot.py --verbose-
>> helpful
>> $HOME=/Users/lisa
>> matplotlib data path /Users/lisa/.local/lib/python2.6/site-packages/
>> matplotlib/mpl-data
>> loaded rc file /Users/lisa/.matplotlib/matplotlibrc
>> matplotlib version 0.99.1.1
>> verbose.level helpful
>> interactive is True
>> units is False
>> platform is darwin
>> CONFIGDIR=/Users/lisa/.matplotlib
>> Using fontManager instance from /Users/lisa/.matplotlib/ 
>> fontList.cache
>> backend TkAgg version 8.5
>> Traceback (most recent call last):
>>   File "simple_plot.py", line 2, in 
>> plot([1,2,3])
>>   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 2134, in plot
>> ax = gca()
>>   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 582, in gca
>> ax =  gcf().gca(**kwargs)
>>   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 276, in gcf
>> return figure()
>>   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 254, in figure
>> **kwargs)
>>   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> backends/backend_tkagg.py", line 91, in new_figure_manager
>> canvas = FigureCanvasTkAgg(figure, master=window)
>>   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> backends/backend_tkagg.py", line 158, in __init__
>> master=self._tkcanvas, width=w, height=h)
>>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
>> python2.6/lib-tk/Tkinter.py", line 3284, in __init__
>> Image.__init__(self, 'photo', name, cnf, master, **kw)
>>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
>> python2.6/lib-tk/Tkinter.py", line 3240, in __init__
>> self.tk.call(('image', 'create', imgtype, name,) + options)
>> _tkinter.TclError: integer value too large to represent
>>
>>
>> Lisa
>>
>>
>> On Dec 2, 2009, at 2:17 PM, William Carithers wrote:
>>
>>> Hi Lisa,
>>>
>>> I had lots of trouble installing on 10.6 as well. What finally
>>> worked for me
>>> is to use the (recommended) file make.osx that comes with the
>>> matplotlib
>>> download. You have to edit that file to point to the versions of
>>> Python (you
>>> want 2.6) and OSX (you want 10.6). I'm attaching a version that has
>>> all
>>> these edits already made. (I'm assuming you have an intel Mac, not a
>>> ppc).
>>>
>>> Look at the top of the file and you will see an example command line
>>> that
>>> begins with PREFIX. You'll execute that command line with the  
>>> example
>>> directory changed to your directory and I highly recommend choosing
>>> the
>>> directory /Users/(whatever your user name is)/.local  All the
>>> libraries will
>>> be installed there and Python will know how to find them even  
>>> without
>>> explicitly putting them in any PATH variable. This command line will
>>> even
>>> check for required dependencies like freetype2, pnglib, ... And will
>>> go them
>>> and install them for you if you don't already have them. The command
>>> line
>>> should look like:
>>> sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch  
>>> deps
>>> mpl_install
>>>
>>> Good luck,
>>> Bill
>>> On 12/2/09 12:31 PM, "Lisa M Winter"   
>>> wrote:
>>>
 Hello.

 I am finding it very difficult to install matplotlib with snow
 leopard.  I have the Apple XCODE installed along with numpy  
 (which I
 have tested and works) and am running the python 2.6 version that
 comes with the Mac.

 I have run into the following problems:
 1) The diskimage installation: When I open the installer, I am told
 that I can not install matplotlib on my disk because I do not  
 have a
 system version of python 2.6.  I do not understand this error  
 since I
 am running the default version (which is 2.6.1).

 2) As another person on the list pointed out, easy_install  
 matplotlib
 tries to install an older version that does not work with the newer
 version of numpy.

 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg.  I was able to
 install matplotlib, seemingly.  When I import pylab into python,  
 I do
 not get any errors.  However, I do get an error when I try to plot.
 With the default backend

Re: [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread William Carithers
Hi Lisa,

Hmm. I also use TKAgg with no problems. Looking at your code, it looks like
you are trying the first example in the tutorial. Just to be sure, could you
post/send a full listing of your simple_plot.py?

Thanks,
Bill

On 12/2/09 2:01 PM, "Lisa M Winter"  wrote:

> Thanks for the pointers, Bill.
> 
> I tried installing from source as you suggested, but I am getting the
> same errors when I try to plot.  What backend are you using?
> 
> Here is what I get when I try using TkAgg:
> 
> casa98-125-dhcp:.matplotlib lisa$ python simple_plot.py --verbose-
> helpful
> $HOME=/Users/lisa
> matplotlib data path /Users/lisa/.local/lib/python2.6/site-packages/
> matplotlib/mpl-data
> loaded rc file /Users/lisa/.matplotlib/matplotlibrc
> matplotlib version 0.99.1.1
> verbose.level helpful
> interactive is True
> units is False
> platform is darwin
> CONFIGDIR=/Users/lisa/.matplotlib
> Using fontManager instance from /Users/lisa/.matplotlib/fontList.cache
> backend TkAgg version 8.5
> Traceback (most recent call last):
>File "simple_plot.py", line 2, in 
>  plot([1,2,3])
>File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 2134, in plot
>  ax = gca()
>File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 582, in gca
>  ax =  gcf().gca(**kwargs)
>File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 276, in gcf
>  return figure()
>File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 254, in figure
>  **kwargs)
>File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> backends/backend_tkagg.py", line 91, in new_figure_manager
>  canvas = FigureCanvasTkAgg(figure, master=window)
>File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> backends/backend_tkagg.py", line 158, in __init__
>  master=self._tkcanvas, width=w, height=h)
>File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/lib-tk/Tkinter.py", line 3284, in __init__
>  Image.__init__(self, 'photo', name, cnf, master, **kw)
>File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/lib-tk/Tkinter.py", line 3240, in __init__
>  self.tk.call(('image', 'create', imgtype, name,) + options)
> _tkinter.TclError: integer value too large to represent
> 
> 
> Lisa
> 
> 
> On Dec 2, 2009, at 2:17 PM, William Carithers wrote:
> 
>> Hi Lisa,
>> 
>> I had lots of trouble installing on 10.6 as well. What finally
>> worked for me
>> is to use the (recommended) file make.osx that comes with the
>> matplotlib
>> download. You have to edit that file to point to the versions of
>> Python (you
>> want 2.6) and OSX (you want 10.6). I'm attaching a version that has
>> all
>> these edits already made. (I'm assuming you have an intel Mac, not a
>> ppc).
>> 
>> Look at the top of the file and you will see an example command line
>> that
>> begins with PREFIX. You'll execute that command line with the example
>> directory changed to your directory and I highly recommend choosing
>> the
>> directory /Users/(whatever your user name is)/.local  All the
>> libraries will
>> be installed there and Python will know how to find them even without
>> explicitly putting them in any PATH variable. This command line will
>> even
>> check for required dependencies like freetype2, pnglib, ... And will
>> go them
>> and install them for you if you don't already have them. The command
>> line
>> should look like:
>> sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch deps
>> mpl_install
>> 
>> Good luck,
>> Bill
>> On 12/2/09 12:31 PM, "Lisa M Winter"  wrote:
>> 
>>> Hello.
>>> 
>>> I am finding it very difficult to install matplotlib with snow
>>> leopard.  I have the Apple XCODE installed along with numpy (which I
>>> have tested and works) and am running the python 2.6 version that
>>> comes with the Mac.
>>> 
>>> I have run into the following problems:
>>> 1) The diskimage installation: When I open the installer, I am told
>>> that I can not install matplotlib on my disk because I do not have a
>>> system version of python 2.6.  I do not understand this error since I
>>> am running the default version (which is 2.6.1).
>>> 
>>> 2) As another person on the list pointed out, easy_install matplotlib
>>> tries to install an older version that does not work with the newer
>>> version of numpy.
>>> 
>>> 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg.  I was able to
>>> install matplotlib, seemingly.  When I import pylab into python, I do
>>> not get any errors.  However, I do get an error when I try to plot.
>>> With the default backend TkAgg (version 8.5), I get the following
>>> error when I try to plot:
>>> _tkinter.TclError: integer value too large to represent
>>> 
>>> When I try to change the backend to MacOSX, a window opens labeled
>>> Figure 1, but nothing plots.  With the verbose level on helpful, I
>>> find only that

Re: [Matplotlib-users] Plotting curves filled with nonuniform color patch

2009-12-02 Thread Tony S Yu

On Dec 2, 2009, at 3:53 PM, Tony S Yu wrote:

> Hi,
> 
> I'm having hard time understanding some of the differences between functions 
> used to plot color patches (not sure what to call them).
> 
> I'm trying to fill a curve with a nonuniform color patch (like fill or 
> fill_between but the color in the patch varies). I've attached code that 
> almost does what I want; my question concerns the color patch (which is 
> created by the call to plt.pcolor in the code below). I'd like to have 
> nonuniform grid spacing in the color values, and also shading (i.e. 
> interpolation of color between points). Here's what I understand:
> 
> pcolor: allows nonuniform grid spacing, but it doesn't do shading.
> 
> imshow: allows color shading, but requires uniform spacing
> 
> pcolormesh: allows color interpolation and nonuniform grid spacing
> 
> pcolormesh seems like the ideal candidate, but when I replace pcolor with 
> pcolormesh (code commented out below pcolor call), the path doesn't get 
> clipped by set_clip_path (but no errors are raised); in other words, the 
> color shading fills the entire plot area. Is this a bug?
> 
> Is there a way of making this plot work that I've overlooked?
> 
> Thanks!
> -Tony


Nevermind, I found NonUniformImage after some digging. The working code is 
attached below if anyone is interested. 

If anyone knows the answer, I'm still curious if the clipping behavior for 
pcolormesh is a bug.

Thanks,
-Tony



# example code

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.image import NonUniformImage


def nonuniform_imshow(x, y, C, **kwargs):
"""Plot image with nonuniform pixel spacing.

This function is a convenience method for calling image.NonUniformImage.
"""
ax = plt.gca()
im = NonUniformImage(ax, **kwargs)
im.set_data(x, y, C)
ax.images.append(im)
return im


def plot_filled_curve(x, y, c):
"""Plot curve filled with linear color gradient

Parameters
--
x, y : arrays
points describing curve
c : array
color values underneath curve. Must match the lengths of `x` and `y`.
"""
# add end points so that fill extends to the x-axis
x_closed = np.concatenate([x[:1], x, x[-1:]])
y_closed = np.concatenate([[0], y, [0]])
# fill between doesn't work here b/c it returns a PolyCollection, plus it
# adds the lower half of the plot by adding a Rect with a border
patch, = plt.fill(x_closed, y_closed, facecolor='none')
im = nonuniform_imshow(x, [0, y.max()], np.vstack((c, c)), 
   interpolation='bilinear', cmap=plt.cm.gray)
im.set_clip_path(patch)

if __name__ == '__main__':
line = np.linspace(0, 1, 6)
x = np.hstack((line, [1, 2]))
y = np.hstack((line**2, [1, 1]))
c = np.hstack((line, [0, 0]))
plot_filled_curve(x, y, c)
plt.show()



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread Lisa M Winter
Thanks for the pointers, Bill.

I tried installing from source as you suggested, but I am getting the  
same errors when I try to plot.  What backend are you using?

Here is what I get when I try using TkAgg:

casa98-125-dhcp:.matplotlib lisa$ python simple_plot.py --verbose- 
helpful
$HOME=/Users/lisa
matplotlib data path /Users/lisa/.local/lib/python2.6/site-packages/ 
matplotlib/mpl-data
loaded rc file /Users/lisa/.matplotlib/matplotlibrc
matplotlib version 0.99.1.1
verbose.level helpful
interactive is True
units is False
platform is darwin
CONFIGDIR=/Users/lisa/.matplotlib
Using fontManager instance from /Users/lisa/.matplotlib/fontList.cache
backend TkAgg version 8.5
Traceback (most recent call last):
   File "simple_plot.py", line 2, in 
 plot([1,2,3])
   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/ 
pyplot.py", line 2134, in plot
 ax = gca()
   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/ 
pyplot.py", line 582, in gca
 ax =  gcf().gca(**kwargs)
   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/ 
pyplot.py", line 276, in gcf
 return figure()
   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/ 
pyplot.py", line 254, in figure
 **kwargs)
   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/ 
backends/backend_tkagg.py", line 91, in new_figure_manager
 canvas = FigureCanvasTkAgg(figure, master=window)
   File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/ 
backends/backend_tkagg.py", line 158, in __init__
 master=self._tkcanvas, width=w, height=h)
   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
python2.6/lib-tk/Tkinter.py", line 3284, in __init__
 Image.__init__(self, 'photo', name, cnf, master, **kw)
   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
python2.6/lib-tk/Tkinter.py", line 3240, in __init__
 self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: integer value too large to represent


Lisa


On Dec 2, 2009, at 2:17 PM, William Carithers wrote:

> Hi Lisa,
>
> I had lots of trouble installing on 10.6 as well. What finally  
> worked for me
> is to use the (recommended) file make.osx that comes with the  
> matplotlib
> download. You have to edit that file to point to the versions of  
> Python (you
> want 2.6) and OSX (you want 10.6). I'm attaching a version that has  
> all
> these edits already made. (I'm assuming you have an intel Mac, not a  
> ppc).
>
> Look at the top of the file and you will see an example command line  
> that
> begins with PREFIX. You'll execute that command line with the example
> directory changed to your directory and I highly recommend choosing  
> the
> directory /Users/(whatever your user name is)/.local  All the  
> libraries will
> be installed there and Python will know how to find them even without
> explicitly putting them in any PATH variable. This command line will  
> even
> check for required dependencies like freetype2, pnglib, ... And will  
> go them
> and install them for you if you don't already have them. The command  
> line
> should look like:
> sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch deps
> mpl_install
>
> Good luck,
> Bill
> On 12/2/09 12:31 PM, "Lisa M Winter"  wrote:
>
>> Hello.
>>
>> I am finding it very difficult to install matplotlib with snow
>> leopard.  I have the Apple XCODE installed along with numpy (which I
>> have tested and works) and am running the python 2.6 version that
>> comes with the Mac.
>>
>> I have run into the following problems:
>> 1) The diskimage installation: When I open the installer, I am told
>> that I can not install matplotlib on my disk because I do not have a
>> system version of python 2.6.  I do not understand this error since I
>> am running the default version (which is 2.6.1).
>>
>> 2) As another person on the list pointed out, easy_install matplotlib
>> tries to install an older version that does not work with the newer
>> version of numpy.
>>
>> 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg.  I was able to
>> install matplotlib, seemingly.  When I import pylab into python, I do
>> not get any errors.  However, I do get an error when I try to plot.
>> With the default backend TkAgg (version 8.5), I get the following
>> error when I try to plot:
>> _tkinter.TclError: integer value too large to represent
>>
>> When I try to change the backend to MacOSX, a window opens labeled
>> Figure 1, but nothing plots.  With the verbose level on helpful, I
>> find only that "backend MacOSX version unknown".
>>
>> Has anyone seen any of these problems before and have an idea as to
>> how to fix this?  If not, is there another method that I should try
>> (I'm hesitant to try to build/install from the source).
>>
>> Thank you for any help!
>>
>> --
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> 

Re: [Matplotlib-users] Saving a plot to EPS

2009-12-02 Thread John Hunter
On Wed, Dec 2, 2009 at 3:20 PM, Michael Cohen  wrote:
> Hi,
> To add more information.  I am trying this on two separate installs of
> matplotlib 0.99, both using TkAgg as the backend.  One produces an
> unreadable file, the other does produce a readable EPS.  However, even
> in this case, zooming in on the image shows that what is being saved is
> bitmapped, not a vector graphic.

Could you please post some sample code and the EPS it generates, as
well as platform information and any specific rc settings you may
have?

Thanks,
JDH

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Saving a plot to EPS

2009-12-02 Thread Michael Cohen
Hi,
To add more information.  I am trying this on two separate installs of 
matplotlib 0.99, both using TkAgg as the backend.  One produces an 
unreadable file, the other does produce a readable EPS.  However, even 
in this case, zooming in on the image shows that what is being saved is 
bitmapped, not a vector graphic.

Cheers
Mike

Michael Cohen wrote:
> Hi all,
> I made a typical plot, and tried to save it to EPS.  The resulting file 
> is un-openable in gimp, the gnome thumbnail viewer, evince, and anything 
> else I have tried.
> Is there any problem saving a plot to EPS at the moment?

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread William Carithers
Hi Lisa,

I had lots of trouble installing on 10.6 as well. What finally worked for me
is to use the (recommended) file make.osx that comes with the matplotlib
download. You have to edit that file to point to the versions of Python (you
want 2.6) and OSX (you want 10.6). I'm attaching a version that has all
these edits already made. (I'm assuming you have an intel Mac, not a ppc).

Look at the top of the file and you will see an example command line that
begins with PREFIX. You'll execute that command line with the example
directory changed to your directory and I highly recommend choosing the
directory /Users/(whatever your user name is)/.local  All the libraries will
be installed there and Python will know how to find them even without
explicitly putting them in any PATH variable. This command line will even
check for required dependencies like freetype2, pnglib, ... And will go them
and install them for you if you don't already have them. The command line
should look like:
sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch deps
mpl_install

Good luck,
Bill
On 12/2/09 12:31 PM, "Lisa M Winter"  wrote:

> Hello.
> 
> I am finding it very difficult to install matplotlib with snow
> leopard.  I have the Apple XCODE installed along with numpy (which I
> have tested and works) and am running the python 2.6 version that
> comes with the Mac.
> 
> I have run into the following problems:
> 1) The diskimage installation: When I open the installer, I am told
> that I can not install matplotlib on my disk because I do not have a
> system version of python 2.6.  I do not understand this error since I
> am running the default version (which is 2.6.1).
> 
> 2) As another person on the list pointed out, easy_install matplotlib
> tries to install an older version that does not work with the newer
> version of numpy.
> 
> 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg.  I was able to
> install matplotlib, seemingly.  When I import pylab into python, I do
> not get any errors.  However, I do get an error when I try to plot.
> With the default backend TkAgg (version 8.5), I get the following
> error when I try to plot:
> _tkinter.TclError: integer value too large to represent
> 
> When I try to change the backend to MacOSX, a window opens labeled
> Figure 1, but nothing plots.  With the verbose level on helpful, I
> find only that "backend MacOSX version unknown".
> 
> Has anyone seen any of these problems before and have an idea as to
> how to fix this?  If not, is there another method that I should try
> (I'm hesitant to try to build/install from the source).
> 
> Thank you for any help!
> 
> --
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users



make.osx
Description: Binary data
--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Plotting curves filled with nonuniform color patch

2009-12-02 Thread Tony S Yu
Hi,

I'm having hard time understanding some of the differences between functions 
used to plot color patches (not sure what to call them).

I'm trying to fill a curve with a nonuniform color patch (like fill or 
fill_between but the color in the patch varies). I've attached code that almost 
does what I want; my question concerns the color patch (which is created by the 
call to plt.pcolor in the code below). I'd like to have nonuniform grid spacing 
in the color values, and also shading (i.e. interpolation of color between 
points). Here's what I understand:

pcolor: allows nonuniform grid spacing, but it doesn't do shading.

imshow: allows color shading, but requires uniform spacing

pcolormesh: allows color interpolation and nonuniform grid spacing

pcolormesh seems like the ideal candidate, but when I replace pcolor with 
pcolormesh (code commented out below pcolor call), the path doesn't get clipped 
by set_clip_path (but no errors are raised); in other words, the color shading 
fills the entire plot area. Is this a bug?

Is there a way of making this plot work that I've overlooked?

Thanks!
-Tony


# example code

import matplotlib.pyplot as plt
import numpy as np

def plot_filled_curve(x, y, c):
"""Plot curve filled with color patch

Parameters
--
x, y : arrays
points describing curve
c : array
value of describing color gradient filling the curve. Must match the
lengths of `x` and `y`.
"""
# add end points so that fill extends to the x-axis
x_closed = np.concatenate([x[:1], x, x[-1:]])
y_closed = np.concatenate([[0], y, [0]])
# fill between doesn't work here b/c it returns a PolyCollection, plus it
# adds the lower half of the plot by adding a Rect with a border
patch, = plt.fill(x_closed, y_closed, facecolor='none')
X, Y = np.meshgrid(x, [0, y.max()])
# take average since C specifies color in between X, Y points
C = [((c[:-1] + c[1:]) / 2.)]
im = plt.pcolor(X, Y, C, cmap=plt.cm.gray, vmin=0, vmax=1)
# C = np.vstack((c, c))
# im = plt.pcolormesh(X, Y, C,
# cmap=plt.cm.gray, vmin=0, vmax=1, shading='gouraud')
im.set_clip_path(patch)

if __name__ == '__main__':
x0 = .45
x = np.linspace(0, 1, 11)
x = np.insert(x, (5, 5), (x0,)*2)
y = np.hstack(([2]*7, 2*np.linspace(0.9, 0, 6)**2))
c = np.hstack(([0]*6, [1], np.linspace(0.9,0,6)))
plot_filled_curve(x, y, c)
plt.show()


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Saving a plot to EPS

2009-12-02 Thread Michael Cohen
Hi all,
I made a typical plot, and tried to save it to EPS.  The resulting file 
is un-openable in gimp, the gnome thumbnail viewer, evince, and anything 
else I have tried.
Is there any problem saving a plot to EPS at the moment?

Cheers
Mike

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-02 Thread Lisa M Winter
Hello.

I am finding it very difficult to install matplotlib with snow  
leopard.  I have the Apple XCODE installed along with numpy (which I  
have tested and works) and am running the python 2.6 version that  
comes with the Mac.

I have run into the following problems:
1) The diskimage installation: When I open the installer, I am told  
that I can not install matplotlib on my disk because I do not have a  
system version of python 2.6.  I do not understand this error since I  
am running the default version (which is 2.6.1).

2) As another person on the list pointed out, easy_install matplotlib  
tries to install an older version that does not work with the newer  
version of numpy.

3) I downloaded the matplotlib-0.99.1.1-py2.6 egg.  I was able to  
install matplotlib, seemingly.  When I import pylab into python, I do  
not get any errors.  However, I do get an error when I try to plot.   
With the default backend TkAgg (version 8.5), I get the following  
error when I try to plot:
_tkinter.TclError: integer value too large to represent

When I try to change the backend to MacOSX, a window opens labeled  
Figure 1, but nothing plots.  With the verbose level on helpful, I  
find only that "backend MacOSX version unknown".

Has anyone seen any of these problems before and have an idea as to  
how to fix this?  If not, is there another method that I should try  
(I'm hesitant to try to build/install from the source).

Thank you for any help!

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] AxesGrid problem.

2009-12-02 Thread Ryan Neve
Hello,

I'm trying to use AxesGrid but I'm running into a problem:
I can plot a single pcolor plot:
[image: 58dFK.png]
But when I try to use AxesGrid, my pcolor plot is ending up where I expect
my colorbar to be.
[image: mEbTA.png]

I want to have up to 6 of these plots stacked vertically, sharing a common
time axis and y (depth) scale.

I'll try to simplify my code to show what I'm doing:

# I have arrays x_grid and y_grid for time and water depth.
# z_dim is a dictionary of arrays (one for each plot)
# In the plot above it has two arrays.
from matplotlib import pyplot
nrows = len(z_dim) # Number of rows is the number of arrays
My_figure = pyplot.figure(1,(8,8))
my_grid = AxesGrid(My_figure, 111, #Is this always 111?
nrows_ncols = (nrows,1), # Always one column
axes_pad = 0.1,
add_all=True,
share_all=True, # They all share the same time and depth
scales
label_mode = "L",
cbar_location="right",
cbar_mode="each",
cbar_size="7%",
cbar_pad="2%",
)
for row_no,parameter in enumerate(z_dim):
ax = my_grid[row_no]
ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
pyplot.draw()
pyplot.show()

I eventually want to end up with something like this matlab output (which I
didn't generate):
[image: jiIaK.png]
but without the duplication of x scales.

I'm new to pyplot and even after reading the documentation much of this is
baffling.

-Ryan
--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap099.4 and geos

2009-12-02 Thread Jeff Whitaker
xiaoni wrote:
> Jeff,
> Just to be safe because I am going to operate on the root:
> 1) ls -l /usr/local/lib:   
> libgeos-3.2.0.so
> libgeos.so -> libgeos-3.2.0.so
Xianoi:  I'm assuming you installed libgeos 3.2.0rc1 yourself in 
/usr/local, and nothing is linked against it besides your non-working 
basemap?  If so, it should be safe to do

rm /usr/local/lib/libgeos*
>
> shall I just remove libgeos-3.2.0.so ? But then the link for 
> libgeos.so may not work.
>
> 2) ls /usr/local/include:
> geos  geos_c.h  geos.h

rm /usr/local/include/geos*h
>
> and in the folder of geos, there are a lot of files and headers.
> To remove the geos3.2 headers, shall I just remove  
> /usr/local/include/geos_c.h and /usr/local/include/geos.h ? I can not 
> tell where the headers of geos3.1.

presumably in /usr/include.  If not, you probably need to install a 
libgeos-dev package or somesuch.

-Jeff
>
> Many thanks again !
>
> xiaoni
>
> 
> *From:* Jeff Whitaker 
> *To:* xiaoni 
> *Cc:* Matplotlib Users 
> *Sent:* Wed, December 2, 2009 5:55:58 PM
> *Subject:* Re: [Matplotlib-users] basemap099.4 and geos
>
> xiaoni wrote:
> > Jeff,
> >Many thanks !
> >
> > ldd  /usr/local/lib/python2.6/dist-packages/_geoslib.so
> > The results are:
> >linux-gate.so .1 =>  (0x00cf2000)
> >libgeos_c.so .1 => 
> /usr/local/lib/libgeos_c.so.1 (0x00944000)
> >libgeos-3.1.0.so  => 
> /usr/lib/libgeos-3.1.0.so (0x005cd000)
> >libpthread.so .0 => 
> /lib/tls/i686/cmov/libpthread.so.0 (0x00a0e000)
> >libc.so .6 => /lib/tls/i686/cmov/libc.so.6 
> (0x00165000)
> >libgeos-3.2.0.so  => 
> /usr/local/lib/libgeos-3.2.0.so (0xb75c1000)
> >libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00d5c000)
> >libm.so .6 => /lib/tls/i686/cmov/libm.so.6 
> (0x00cf7000)
> >libgcc_s.so .1 => /lib/libgcc_s.so.1 
> (0x00f77000)
> >/lib/ld-linux.so.2 (0x00148000)
> >
> > It seems that it mixed geos3.1 and 3.2 ?
>
> Xianoi:  Yep, there's your problem right there.  My suggestion is to 
> remove the 3.2.0 geos lib and headers from /usr/local/lib and 
> /usr/local/include and try again.
>
> -Jeff
> >
> > If I have to clean out all the old versions of basemap, _geoslib.so 
>  and libgeos, then rebuild again, What is the safe 
> way to do so ? I am afraid that I may damage the system if I simplely 
> apply "rm". Do you have some suggestion about the steps of deleting ?
> >
> > Many thanks !!
> >
> > xiaoni
> >
> >
> > 
> > *From:* Jeff Whitaker mailto:jsw...@fastmail.fm>>
> > *To:* xiaoni mailto:wang...@yahoo.com>>; 
> Matplotlib Users  >
> > *Sent:* Wed, December 2, 2009 5:42:17 PM
> > *Subject:* Re: [Matplotlib-users] basemap099.4 and geos
> >
> > xiaoni wrote:
> > > Jeff,
> > >Many thanks for your help ! The problem was : there was a 
> segmentation error when I call Basemap. I applied the following steps, 
> and then tried to launch ipython, it still has the same problem.
> > >  --add export GEOS_DIR=/usr/local/lib
> > > --download basemap 099.4 to /home/xiaoni/software, where the 
> previous version099.3 is saved also
> > > -- sudo python setup.py   install
> > >
> > > The installation is OK. Then I test:
> > > --ls  -l  /usr/local/lib/libgeos.so  : /usr/local/lib/libgeos.so -> 
> libgeos-3.2.0.so 
> > > --ls  -l /usr/lib/libgeos.so  : /usr/lib/libgeos.so -> 
> libgeos-3.1.0.so 
> > > --ls -l  /usr/local/lib/libgeos.so  : /usr/local/lib/libgeos.so -> 
> libgeos-3.2.0.so
> > > --locate libgeos.so  
>   : /usr/lib/libgeos.so , and /usr/local/lib/libgeos.so
> > > --locate _geoslib  :
> > > 
> /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> > > 
> /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> > > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.c
> > > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx
> > > /usr/local/lib/python2.6/dist-packages/_geoslib.so
> > > (in fact I have saved both basemap -099.3 and basemap-0.99.4 in 
> the /home/xiaoni/software. This result only shows 0.99.3 and is 
> strange to me).
> > >
> > > Many thanks again !!
> > >
> > > xiaoni
> >
> > Xiaoni:  Is there no traceback?  Can you run ldd on the _geoslib.so 
>  that you are actually importing when the error 
> occurs (presumably 
> /usr/local/lib/python2.6/dist-packages/_geoslib.so)?  That will tell 
> you what version of the geos library you actually linked.  I don't 
> think I can be of much

[Matplotlib-users] usetex on Windows 7, hangup without any error

2009-12-02 Thread Marco Müller
Dear matplotlibbers,

I am currently trying to convince matplotlib using LaTeX for text
processing. Unfortunately, it seems to hang up at some point in the
minimal example script from the user's guide (also posted below)
without throwing any warning or error. As I am new to python and
matplotlib, I am not able to track down the problem.

My OS is Windows 7 (Professional), 64bit, using MikTeX and GPL
Ghostscript (all in my PATH), following is an example cmd.exe session:

C:\somewhere>python --version
Python 2.6.4

c:\somewhere> tex --version && latex --version && pdftex --version &&
pdflatex --version
MiKTeX-TeX 2.8.3489 (3.1415926) (MiKTeX 2.8)
Copyright (C) 1982 by D. E. Knuth; all rights are reserved.
TeX is a trademark of the American Mathematical Society.
MiKTeX-pdfTeX 2.8.3563 (1.40.10) (MiKTeX 2.8)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2006 Han The Thanh
TeX is a trademark of the American Mathematical Society.
MiKTeX-pdfTeX 2.8.3563 (1.40.10) (MiKTeX 2.8)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2006 Han The Thanh
TeX is a trademark of the American Mathematical Society.
MiKTeX-pdfTeX 2.8.3563 (1.40.10) (MiKTeX 2.8)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2006 Han The Thanh
TeX is a trademark of the American Mathematical Society.

c:\somewhere>dvipng --version
This is dvipng 1.12 Copyright 2002-2008 Jan-Ake Larsson
dvipng 1.12
kpathsea version 3.3.2
Compiled with Freetype 2.3.7
Copyright (C) 2002-2008 Jan-Ake Larsson.
There is NO warranty.  You may redistribute this software
under the terms of the GNU Lesser General Public License
version 3, see the COPYING file in the dvipng distribution
or .

c:\somewhere>gswin32c --version
8.70

c:\somewhere>type testLaTeX.py
from matplotlib import rc
from numpy import arange, cos, pi
from pylab import figure, axes, plot, xlabel, ylabel, title, grid, savefig, show
rc('text', usetex=True)
figure(1)
ax = axes([0.1, 0.1, 0.8, 0.7])
t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)+2
plot(t, s)
xlabel(r'\textbf{time (s)}')
ylabel(r'\textit{voltage (mV)}',fontsize=16)
title(r"\TeX\ is Number
$\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", fontsize=16,
color=
'r')
grid(True)
savefig('tex_demo')
show()

c:\somewhere>python testLaTeX.py --verbose-helpful
$HOME=C:\Users\someUser
CONFIGDIR=C:\Users\someUser\.matplotlib
matplotlib data path c:\opensource\python\lib\site-packages\matplotlib\mpl-data
loaded rc file 
c:\opensource\python\lib\site-packages\matplotlib\mpl-data\matplotlibrc
matplotlib version 0.99.1
verbose.level helpful
interactive is False
units is False
platform is win32
font search path
['c:\\opensource\\python\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf',
'c
:\\opensource\\python\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\afm']
generated new fontManager
backend TkAgg version 8.5
findfont: Matching
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=
medium to Bitstream Vera Sans
(c:\opensource\python\lib\site-packages\matplotlib\mpl-data\fonts\ttf\
Vera.ttf) with score of 0.00

(Here it hangs up AFAIK doing nothing, at least python is not using
CPU resources)

The --verbose-debug flag only shows the modules loaded in addition to
the latter output, but at the point of hangup no additionally
information is provided.

I am very thankful for any hint in which direction to look,
Best regards,
Marco

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap099.4 and geos

2009-12-02 Thread Jeff Whitaker
xiaoni wrote:
> Jeff,
> Many thanks !
>
> ldd  /usr/local/lib/python2.6/dist-packages/_geoslib.so
> The results are:
>linux-gate.so.1 =>  (0x00cf2000)
> libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 (0x00944000)
> libgeos-3.1.0.so => /usr/lib/libgeos-3.1.0.so (0x005cd000)
> libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00a0e000)
> libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00165000)
> libgeos-3.2.0.so => /usr/local/lib/libgeos-3.2.0.so (0xb75c1000)
> libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00d5c000)
> libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00cf7000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00f77000)
> /lib/ld-linux.so.2 (0x00148000)
>
> It seems that it mixed geos3.1 and 3.2 ?

Xianoi:  Yep, there's your problem right there.  My suggestion is to 
remove the 3.2.0 geos lib and headers from /usr/local/lib and 
/usr/local/include and try again.

-Jeff
>
> If I have to clean out all the old versions of basemap, _geoslib.so 
> and libgeos, then rebuild again, What is the safe way to do so ? I am 
> afraid that I may damage the system if I simplely apply "rm". Do you 
> have some suggestion about the steps of deleting ?
>
> Many thanks !!
>
> xiaoni
>
>
> 
> *From:* Jeff Whitaker 
> *To:* xiaoni ; Matplotlib Users 
> 
> *Sent:* Wed, December 2, 2009 5:42:17 PM
> *Subject:* Re: [Matplotlib-users] basemap099.4 and geos
>
> xiaoni wrote:
> > Jeff,
> >Many thanks for your help ! The problem was : there was a 
> segmentation error when I call Basemap. I applied the following steps, 
> and then tried to launch ipython, it still has the same problem.
> >  --add export GEOS_DIR=/usr/local/lib
> > --download basemap 099.4 to /home/xiaoni/software, where the 
> previous version099.3 is saved also
> > -- sudo python setup.py  install
> >
> > The installation is OK. Then I test:
> > --ls  -l  /usr/local/lib/libgeos.so  : /usr/local/lib/libgeos.so -> 
> libgeos-3.2.0.so 
> > --ls  -l /usr/lib/libgeos.so  : /usr/lib/libgeos.so -> 
> libgeos-3.1.0.so 
> > --ls -l  /usr/local/lib/libgeos.so  : /usr/local/lib/libgeos.so -> 
> libgeos-3.2.0.so
> > --locate libgeos.so   : 
> /usr/lib/libgeos.so , and /usr/local/lib/libgeos.so
> > --locate _geoslib  :
> > 
> /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> > 
> /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.c
> > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx
> > /usr/local/lib/python2.6/dist-packages/_geoslib.so
> > (in fact I have saved both basemap -099.3 and basemap-0.99.4 in the 
> /home/xiaoni/software. This result only shows 0.99.3 and is strange to 
> me).
> >
> > Many thanks again !!
> >
> > xiaoni
>
> Xiaoni:  Is there no traceback?  Can you run ldd on the _geoslib.so 
>  that you are actually importing when the error 
> occurs (presumably 
> /usr/local/lib/python2.6/dist-packages/_geoslib.so)?  That will tell 
> you what version of the geos library you actually linked.  I don't 
> think I can be of much help here - all I can suggest is that you clean 
> out all old versions of basemap, _geoslib.so and libgeos, then rebuild 
> again.  The fact that there are so may versions floating around 
> increases the chance that you have a version mismatch somewhere.
>
> Also check the build output and make sure there were no errors 
> building _geoslib.so.
>
>
> -Jeff
>
> >
> >
> > 
> > *From:* Jeff Whitaker mailto:jsw...@fastmail.fm>>
> > *To:* xiaoni mailto:wang...@yahoo.com>>
> > *Cc:* matplotlib-users@lists.sourceforge.net 
> 
> > *Sent:* Wed, December 2, 2009 4:47:51 PM
> > *Subject:* Re: [Matplotlib-users] basemap099.4 and geos
> >
> > xiaoni wrote:
> > > Hello, all,
> > >  I have some problem with basemap and geos, and can not use 
> Basemap。
> > > In the below I list the information about basemap and geos in my 
> computer. Hope someone would help me to figure out why it does not 
> work. Many thanks in adance !
> > >
> > > 1) I type:
> > > ---from mpl_toolkits.basemap import Basemap;
> > > ---mpl_toolkits.basemap.__path__
> > > ---mpl_toolkits.basemap.__version__
> > > The results:
> > >/usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap
> > >'0.99.4'
> > >
> > > 2) I also checked the same for matplotlib:
> > >/usr/lib/pymodules/python2.6/matplotlib
> > >0.99.0
> > >
> > > 3) I type: locate _geoslib:
> > >
> > > 
> /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> > > 
> /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> > >

Re: [Matplotlib-users] basemap099.4 and geos

2009-12-02 Thread Jeff Whitaker
xiaoni wrote:
> Jeff,
>Many thanks for your help ! The problem was : there was a 
> segmentation error when I call Basemap. I applied the following steps, 
> and then tried to launch ipython, it still has the same problem.
>  
> --add export GEOS_DIR=/usr/local/lib
> --download basemap 099.4 to /home/xiaoni/software, where the previous 
> version099.3 is saved also
> -- sudo python setup.py install
>
> The installation is OK. Then I test:
> --ls  -l  /usr/local/lib/libgeos.so  : /usr/local/lib/libgeos.so -> 
> libgeos-3.2.0.so
> --ls  -l /usr/lib/libgeos.so   : /usr/lib/libgeos.so -> 
> libgeos-3.1.0.so
> --ls -l  /usr/local/lib/libgeos.so   : /usr/local/lib/libgeos.so -> 
> libgeos-3.2.0.so
> --locate libgeos.so   : /usr/lib/libgeos.so , and 
> /usr/local/lib/libgeos.so
> --locate _geoslib  :
> /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> /home/xiaoni/software/basemap-0.99.3/src/_geoslib.c
> /home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx
> /usr/local/lib/python2.6/dist-packages/_geoslib.so
> (in fact I have saved both basemap -099.3 and basemap-0.99.4 in the 
> /home/xiaoni/software. This result only shows 0.99.3 and is strange to 
> me).
>
> Many thanks again !!
>
> xiaoni

Xiaoni:  Is there no traceback?  Can you run ldd on the _geoslib.so that 
you are actually importing when the error occurs (presumably 
/usr/local/lib/python2.6/dist-packages/_geoslib.so)?  That will tell you 
what version of the geos library you actually linked.  I don't think I 
can be of much help here - all I can suggest is that you clean out all 
old versions of basemap, _geoslib.so and libgeos, then rebuild again.  
The fact that there are so may versions floating around increases the 
chance that you have a version mismatch somewhere.

Also check the build output and make sure there were no errors building 
_geoslib.so.


-Jeff

>
>
> 
> *From:* Jeff Whitaker 
> *To:* xiaoni 
> *Cc:* matplotlib-users@lists.sourceforge.net
> *Sent:* Wed, December 2, 2009 4:47:51 PM
> *Subject:* Re: [Matplotlib-users] basemap099.4 and geos
>
> xiaoni wrote:
> > Hello, all,
> >  I have some problem with basemap and geos, and can not use 
> Basemap。
> > In the below I list the information about basemap and geos in my 
> computer. Hope someone would help me to figure out why it does not 
> work. Many thanks in adance !
> >
> > 1) I type:
> > ---from mpl_toolkits.basemap import Basemap;
> > ---mpl_toolkits.basemap.__path__
> > ---mpl_toolkits.basemap.__version__
> > The results:
> >/usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap
> >'0.99.4'
> >
> > 2) I also checked the same for matplotlib:
> >/usr/lib/pymodules/python2.6/matplotlib
> >0.99.0
> >
> > 3) I type: locate _geoslib:
> >
> > 
> /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> > 
> /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.c  
>
> > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx
> /usr/local/lib/python2.6/dist-packages/_geoslib.so
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/build/lib.linux-i686-2.6/_geoslib.so
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.c
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.pyx
> >
> >
> > 4) I type:  locate libgeos.so  
> >
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2.2.3
> > /home/xiaoni/software/temp/geos-3.2.0rc1/source/.libs/libgeos.so
> > /home/xiaoni/software/temp/lib/libgeos.so
> > /home/xiaoni/software/temp/lib/libgeos.so.2
> > /home/xiaoni/software/temp/lib/libgeos.so.2.2.3
> > /usr/lib/libgeos.so
> > /usr/local/lib/libgeos.so
> > /usr/local/lib/backup2/libgeos.so
> > /usr/local/lib/backup2/libgeos.so.2
> > /usr/local/lib/backup2/libgeos.so.2.2.3
> >
> > 5) locate libgeos_c.so  
> >
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1
> > 
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1T
> > /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so
> > /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1
> > /home/xiaoni/software/temp/geos-3.2.0r

Re: [Matplotlib-users] mplot3d: plot_surface() and contour on grid?

2009-12-02 Thread Reinier Heeres
Hi Matthias,

I have a similar patch lying around somewhere, and I will try to apply
it soon. I've been terribly busy lately, but I expect some nice
mplot3d enhancements in the very near future.

Regards,
Reinier

On Wed, Dec 2, 2009 at 4:22 PM, Matthias Michler
 wrote:
> Hi Andrew,
>
> do you have any idea if the patch (or a part of it) may get a part of
> matplotlib-svn some day?
>
> Kind regards,
> Matthias
>
> On Friday 09 October 2009 23:25:28 Andrew Straw wrote:
>> Matthias Michler wrote:
>> > Hello list,
>> >
>> > I'm not an expert in axes3d, but in case the feature which Nicolas
>> > requested is not possible in an easy manner up to now, I propose an
>> > additional kwarg for axes3d.Axes3D.contour. Something like *offset*. If
>> > offset is None the z-values of the contour lines corresponds to given Z
>> > and otherwise offset is used for the z-values of the contour lines.
>> > I attached a changed axes3d.py and a patch against current svn. The
>> > result is illustrated in the contour3d_demo.png.
>> >
>> > Could any of the experts have a look at it and tell me if this could be
>> > useful, please?
>> >
>> > Thanks in advance for any comments.
>> >
>> > Kind regards
>> > Matthias
>> >
>> > On Wednesday 30 September 2009 19:22:42 Nicolas Bigaouette wrote:
>> >> Hi,
>> >> I have a nice plot_surface() using mplot3d (see attachement).
>> >>
>> >> I'd like to project the surface on the axis xoy, xoz and yoz with a
>> >> contour, similar to this figure:
>> >> http://homepages.ulb.ac.be/~dgonze/INFO/matlab/fig19.jpg
>> >>
>> >> Is it possible using matplotlib and mplot3d?
>> >>
>> >> Thanx!
>>
>> Hi Matthias,
>>
>> I committed your patch to a github branch of MPL, but I'll let Reinier
>> actually commit something based on this to MPL.
>> http://github.com/astraw/matplotlib/tree/dev/michler-3d-contourf-offsets
>>
>> -Andrew
>
>
>
> --
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



-- 
Reinier Heeres
Tel: +31 6 10852639

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-02 Thread Jouni K . Seppänen
Matthias Michler  writes:

> ./root/article.cls.tex: Permission denied
> ./root/article.cls: Permission denied
> ./lost+found/article.cls.tex: Permission denied
> ./lost+found/article.cls: Permission denied
> ./root/article.cls.tex: Permission denied
> ./root/article.cls: Permission denied
> ./lost+found/article.cls.tex: Permission denied
> ./lost+found/article.cls: Permission denied

That looks like a TeX configuration problem. I'm guessing that when TeX
encounters \documentclass{article}, it asks the path-searching library
for "article.cls", and for some reason /root and /lost+found are
included in the path. You don't have permission as normal user to access
these directories, so the library causes error messages to be printed.
The path probably also includes the correct directories, so the search
eventually succeeds, but then article.cls wants to input size10.clo,
causing a new round of errors:

> ./root/size10.clo.tex: Permission denied
> ./root/size10.clo: Permission denied
(etc)

Have you set any TeX-related environment variables or edited any
configuration files? What does "kpsepath tex" print?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting a solid circle on a polar plot

2009-12-02 Thread Matthias Michler
Hi Brian,

does
ax.fill_between(np.linspace(0.0, 2*np.pi,100), np.ones(100))
do what you are after?

Kind regards
Matthias

On Wednesday 02 December 2009 16:42:16 Brian Larsen wrote:
> Hello,
>
> this seems like it should be easy but I am beating my head on the wall
> here.
>
> I am trying to fill in everything rad<=1 in a polar plot (this is a
> spacecraft orbit trace and the circle is the Earth) and can't seem to get
> it.
>
> from pylab import *
> from matplotlib.patches import Circle
> fig=figure()
> ax = fig.add_subplot(111, polar=True)
> ax.plot([2,2,2,2], [2,3,4,5])
> el = Circle((0,0), radius=1,facecolor='black', axes=ax)
> ax.add_artist(el)
> draw()
> # also get the same result plotting with polar()
>
> and of course this dumbell looks nothing like the earth :)
>
> thanks much for any help,
>
> Brian



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap099.4 and geos

2009-12-02 Thread Jeff Whitaker
xiaoni wrote:
> Hello, all,
>  I have some problem with basemap and geos, and can not use Basemap。
> In the below I list the information about basemap and geos in my 
> computer. Hope someone would help me to figure out why it does not 
> work. Many thanks in adance !
>
> 1) I type:
> ---from mpl_toolkits.basemap import Basemap;
> ---mpl_toolkits.basemap.__path__
> ---mpl_toolkits.basemap.__version__
> The results:
> /usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap
> '0.99.4'
>
> 2) I also checked the same for matplotlib:
> /usr/lib/pymodules/python2.6/matplotlib
> 0.99.0
>
> 3) I type: locate _geoslib:
>
> /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> /home/xiaoni/software/basemap-0.99.3/src/_geoslib.c  
>
> /home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx
> /usr/local/lib/python2.6/dist-packages/_geoslib.so
> /home/xiaoni/software/temp/basemap-0.99.3-backup/build/lib.linux-i686-2.6/_geoslib.so
> /home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.c
> /home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.pyx
>
>
> 4) I type:  locate libgeos.so 
>
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2.2.3
> /home/xiaoni/software/temp/geos-3.2.0rc1/source/.libs/libgeos.so
> /home/xiaoni/software/temp/lib/libgeos.so
> /home/xiaoni/software/temp/lib/libgeos.so.2
> /home/xiaoni/software/temp/lib/libgeos.so.2.2.3
> /usr/lib/libgeos.so
> /usr/local/lib/libgeos.so
> /usr/local/lib/backup2/libgeos.so
> /usr/local/lib/backup2/libgeos.so.2
> /usr/local/lib/backup2/libgeos.so.2.2.3
>
> 5) locate libgeos_c.so 
>
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1
> /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1T
> /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so
> /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1
> /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1.6.0
> /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1.6.0T
> /home/xiaoni/software/temp/lib/libgeos_c.so
> /home/xiaoni/software/temp/lib/libgeos_c.so.1
> /home/xiaoni/software/temp/lib/libgeos_c.so.1.1.1
> /usr/lib/libgeos_c.so
> /usr/lib/libgeos_c.so.1
> /usr/lib/libgeos_c.so.1.5.0
> /usr /local/lib/libgeos_c.so.1
> /us r/local/lib/libgeos_c.so.1.6.0
> /usr/local/lib/backup2/libgeos_c.so
> /usr/local/lib/backup2/libgeos_c.so.1
> /usr/local/lib/backup2/libgeos_c.so.1.1.1
>
>   
>
> 6) I also type:
>  ls  -l  /usr/local/lib/python2.6/dist-packages/_geoslib.so
> It does not linked to any files (no pointer)
>
> 2) ls -l  /usr/local/lib/libgeos.so
> /usr/local/lib/libgeos.so -> libgeos-3.2.0.so 
>
> 3) ls  -l  /usr/local/lib/libgeos.so
> /usr/local/lib/libgeos.so -> libgeos-3.2.0.so
>
> 4) ls -l /usr/local/lib/backup2/libgeos.so.2
> /usr/local/lib/backup2/libgeos.so.2 -> libgeos.so 
> .2.2.3
>
> 5) ls -l /usr/local/lib/backup2/libgeos.so.2.2.3
> /usr/local/lib/backup2/libgeos.so.2.2.3, no links
>
>
> It seems that Basemap can not be used because of something wrong with 
> the installation of GEOS ? Anyone would give some hints for help ? I 
> appreciate it a lot !!
>
> xiaoni
>
>
Xianoi:  You never said what the actual problem is with basemap.  I have 
seen segfaults when there are two versions of geos installed (version 2 
and version 3) and you pick up the header from one version and lib from 
the other version.  I suggest setting the GEOS_DIR env var to 
/usr/local/lib and re-running the basemap install (python setup.py 
install), after deleting the existing build directory.  Hopefully then 
it will grab both the header and lib for version 3.2.0 (which by the way 
is a pre-release, as yet untested with basemap).

-Jeff


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
325 BroadwayOffice : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___

[Matplotlib-users] Plotting a solid circle on a polar plot

2009-12-02 Thread Brian Larsen
Hello, 

this seems like it should be easy but I am beating my head on the wall here.

I am trying to fill in everything rad<=1 in a polar plot (this is a spacecraft 
orbit trace and the circle is the Earth) and can't seem to get it.

from pylab import *
from matplotlib.patches import Circle
fig=figure()
ax = fig.add_subplot(111, polar=True)
ax.plot([2,2,2,2], [2,3,4,5])
el = Circle((0,0), radius=1,facecolor='black', axes=ax)
ax.add_artist(el)
draw()
# also get the same result plotting with polar()

and of course this dumbell looks nothing like the earth :)

thanks much for any help,  

Brian



-- 
---
Brian A Larsen, PhD
RBSP-ECT Instrument Suite Scientist

Boston University
Center for Space Physics
725 Commonwealth Ave, Rm 506
Boston, MA 02215-1401
T: 617-358-4945
F: 617-353-6463
balar...@bu.edu 




--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mplot3d: plot_surface() and contour on grid?

2009-12-02 Thread Matthias Michler
Hi Andrew,

do you have any idea if the patch (or a part of it) may get a part of 
matplotlib-svn some day?

Kind regards,
Matthias

On Friday 09 October 2009 23:25:28 Andrew Straw wrote:
> Matthias Michler wrote:
> > Hello list,
> >
> > I'm not an expert in axes3d, but in case the feature which Nicolas
> > requested is not possible in an easy manner up to now, I propose an
> > additional kwarg for axes3d.Axes3D.contour. Something like *offset*. If
> > offset is None the z-values of the contour lines corresponds to given Z
> > and otherwise offset is used for the z-values of the contour lines.
> > I attached a changed axes3d.py and a patch against current svn. The
> > result is illustrated in the contour3d_demo.png.
> >
> > Could any of the experts have a look at it and tell me if this could be
> > useful, please?
> >
> > Thanks in advance for any comments.
> >
> > Kind regards
> > Matthias
> >
> > On Wednesday 30 September 2009 19:22:42 Nicolas Bigaouette wrote:
> >> Hi,
> >> I have a nice plot_surface() using mplot3d (see attachement).
> >>
> >> I'd like to project the surface on the axis xoy, xoz and yoz with a
> >> contour, similar to this figure:
> >> http://homepages.ulb.ac.be/~dgonze/INFO/matlab/fig19.jpg
> >>
> >> Is it possible using matplotlib and mplot3d?
> >>
> >> Thanx!
>
> Hi Matthias,
>
> I committed your patch to a github branch of MPL, but I'll let Reinier
> actually commit something based on this to MPL.
> http://github.com/astraw/matplotlib/tree/dev/michler-3d-contourf-offsets
>
> -Andrew



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-02 Thread Matthias Michler
Hi Darren,

thanks for your reply. The point is that saving pdf, jpg, etc. works fine but 
in case I use ps or eps I get the long error output. Therefore I expected a 
problem in the ps-backend.

Kind regards,
Matthias
 
On Wednesday 02 December 2009 15:57:31 Darren Dale wrote:
> On Mon, Nov 16, 2009 at 9:45 AM, Matthias Michler
>
>  wrote:
> > Hello list,
> >
> > I encounter some strange error output including several "Permission
> > denied" when using usetex=True and saveing eps-pictures. My example is
> > quite easy and the output is attached. (Please notice the resulting
> > figure looks as expected.)
> >
> > import matplotlib
> > matplotlib.rc('text', usetex=True)
> > import matplotlib.pyplot as plt
> > plt.plot([0, 1], [0, 1])
> > plt.savefig("test_usetex_with_savefig_as_eps_file.eps")
> >
> > I have no problems with png-files.
> >
> > Can anybody confirm this behaviour?
> >
> > Kind regards and thanks in advance for any hints,
>
> I cannot reproduce this behavior. It looks like there is some problem
> with your latex environment, not matplotlib. I suggest you ensure
> latex is working properly before trying to use usetex.
>
> Darren



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-02 Thread Darren Dale
On Wed, Dec 2, 2009 at 9:57 AM, Michael Droettboom  wrote:
> I can confirm that this "works for me", so it is probably some sort of
> configuration difference.
>
> Can you provide the error output?  It would be useful to know what
> specifically it is being denied permission for.

He had attached it to the original post.

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-02 Thread Darren Dale
On Mon, Nov 16, 2009 at 9:45 AM, Matthias Michler
 wrote:
> Hello list,
>
> I encounter some strange error output including several "Permission denied"
> when using usetex=True and saveing eps-pictures. My example is quite easy and
> the output is attached. (Please notice the resulting figure looks as
> expected.)
>
> import matplotlib
> matplotlib.rc('text', usetex=True)
> import matplotlib.pyplot as plt
> plt.plot([0, 1], [0, 1])
> plt.savefig("test_usetex_with_savefig_as_eps_file.eps")
>
> I have no problems with png-files.
>
> Can anybody confirm this behaviour?
>
> Kind regards and thanks in advance for any hints,

I cannot reproduce this behavior. It looks like there is some problem
with your latex environment, not matplotlib. I suggest you ensure
latex is working properly before trying to use usetex.

Darren

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-02 Thread Michael Droettboom
I can confirm that this "works for me", so it is probably some sort of 
configuration difference.

Can you provide the error output?  It would be useful to know what 
specifically it is being denied permission for.

Mike

Matthias Michler wrote:
> Hello list,
>
> may be the last message got lost among the lots of mpl-mails. So I'd like to 
> ask you once more for comments. Can anyone confirm this behaviour or should 
> it be due to some wrong configuration on my computer?
>
> Kind regards,
> Matthias 
>
> On Monday 16 November 2009 15:45:08 Matthias Michler wrote:
>   
>> Hello list,
>>
>> I encounter some strange error output including several "Permission denied"
>> when using usetex=True and saveing eps-pictures. My example is quite easy
>> and the output is attached. (Please notice the resulting figure looks as
>> expected.)
>>
>> import matplotlib
>> matplotlib.rc('text', usetex=True)
>> import matplotlib.pyplot as plt
>> plt.plot([0, 1], [0, 1])
>> plt.savefig("test_usetex_with_savefig_as_eps_file.eps")
>>
>> I have no problems with png-files.
>>
>> Can anybody confirm this behaviour?
>>
>> Kind regards and thanks in advance for any hints,
>> Matthias
>> 
>
>
>
> --
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing. 
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-02 Thread Matthias Michler
Hello list,

may be the last message got lost among the lots of mpl-mails. So I'd like to 
ask you once more for comments. Can anyone confirm this behaviour or should 
it be due to some wrong configuration on my computer?

Kind regards,
Matthias 

On Monday 16 November 2009 15:45:08 Matthias Michler wrote:
> Hello list,
>
> I encounter some strange error output including several "Permission denied"
> when using usetex=True and saveing eps-pictures. My example is quite easy
> and the output is attached. (Please notice the resulting figure looks as
> expected.)
>
> import matplotlib
> matplotlib.rc('text', usetex=True)
> import matplotlib.pyplot as plt
> plt.plot([0, 1], [0, 1])
> plt.savefig("test_usetex_with_savefig_as_eps_file.eps")
>
> I have no problems with png-files.
>
> Can anybody confirm this behaviour?
>
> Kind regards and thanks in advance for any hints,
> Matthias



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Engineering prefixed units in tick labels

2009-12-02 Thread Matthias Michler
Hi John, Hello list,

I added the patch to the tracker (ID 2907509).

Kind regards
Matthias
 
On Wednesday 02 December 2009 13:40:29 John Hunter wrote:
> On Wed, Dec 2, 2009 at 4:02 AM, Matthias Michler
>
>  wrote:
> > Hi Jason, Hi list,
> >
> > First of all let me say I like the EngFormatter of Jason.
> > Are there plans to incorparate it into matplotlib?
> > I cannot find any indication for this in current svn, but I would like to
> > see the EngFormatter in matplotlib. Therefore I tried to include Jasons
> > proposal into the ticker.py as a new class EngFormatter including the
> > method 'self.format_eng'.
>
> I am interested in this -i I just missed Jason's original email last
> week so thanks for bringing it back to our attention.  Please post
> this as a patch on the tracker
>
> http://sourceforge.net/tracker2/?group_id=80706
>
> since I don't have time to review it right now and I don't want it to
> fall through the cracks.
>
> JDH



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] basemap099.4 and geos

2009-12-02 Thread xiaoni
Hello, all,
 I have some problem with basemap and geos, and can not use Basemap。
In the below I list the information about basemap and geos in my computer. Hope 
someone would help me to figure out why it does not work. Many thanks in adance 
!

1) I type:
---from mpl_toolkits.basemap import Basemap;
---mpl_toolkits.basemap.__path__
---mpl_toolkits.basemap.__version__
The results:
/usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap
'0.99.4'

2) I also checked the same for matplotlib:
/usr/lib/pymodules/python2.6/matplotlib
0.99.0

3) I type: locate _geoslib:

/home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
/home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
/home/xiaoni/software/basemap-0.99.3/src/_geoslib.c  
/home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx 
/usr/local/lib/python2.6/dist-packages/_geoslib.so
/home/xiaoni/software/temp/basemap-0.99.3-backup/build/lib.linux-i686-2.6/_geoslib.so
/home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.c
/home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.pyx


4) I type:  locate libgeos.so

/home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so
/home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2
/home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2.2.3
/home/xiaoni/software/temp/geos-3.2.0rc1/source/.libs/libgeos.so
/home/xiaoni/software/temp/lib/libgeos.so
/home/xiaoni/software/temp/lib/libgeos.so.2
/home/xiaoni/software/temp/lib/libgeos.so.2.2.3
/usr/lib/libgeos.so
/usr/local/lib/libgeos.so
/usr/local/lib/backup2/libgeos.so
/usr/local/lib/backup2/libgeos.so.2
/usr/local/lib/backup2/libgeos.so.2.2.3

5) locate libgeos_c.so

/home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so
/home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1
/home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1
/home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1T
/home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so
/home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1
/home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1.6.0
/home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1.6.0T
/home/xiaoni/software/temp/lib/libgeos_c.so
/home/xiaoni/software/temp/lib/libgeos_c.so.1
/home/xiaoni/software/temp/lib/libgeos_c.so.1.1.1
/usr/lib/libgeos_c.so
/usr/lib/libgeos_c.so.1
/usr/lib/libgeos_c.so.1.5.0
/usr/local/lib/libgeos_c.so.1
/us
r/local/lib/libgeos_c.so.1.6.0
/usr/local/lib/backup2/libgeos_c.so
/usr/local/lib/backup2/libgeos_c.so.1
/usr/local/lib/backup2/libgeos_c.so.1.1.1

   

6) I also type:
 ls  -l  /usr/local/lib/python2.6/dist-packages/_geoslib.so
It does not linked to any files (no pointer)

2) ls -l  /usr/local/lib/libgeos.so
/usr/local/lib/libgeos.so -> libgeos-3.2.0.so

3) ls  -l  /usr/local/lib/libgeos.so
/usr/local/lib/libgeos.so -> libgeos-3.2.0.so

4) ls -l /usr/local/lib/backup2/libgeos.so.2
/usr/local/lib/backup2/libgeos.so.2 -> libgeos.so.2.2.3

5) ls -l /usr/local/lib/backup2/libgeos.so.2.2.3
/usr/local/lib/backup2/libgeos.so.2.2.3, no links


It seems that Basemap can not be used because of something wrong with the 
installation of GEOS ? Anyone would give some hints for help ? I appreciate it 
a lot !!

xiaoni



  --
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Engineering prefixed units in tick labels

2009-12-02 Thread John Hunter
On Wed, Dec 2, 2009 at 4:02 AM, Matthias Michler
 wrote:
> Hi Jason, Hi list,
>
> First of all let me say I like the EngFormatter of Jason.
> Are there plans to incorparate it into matplotlib?
> I cannot find any indication for this in current svn, but I would like to see
> the EngFormatter in matplotlib. Therefore I tried to include Jasons proposal
> into the ticker.py as a new class EngFormatter including the
> method 'self.format_eng'.


I am interested in this -i I just missed Jason's original email last
week so thanks for bringing it back to our attention.  Please post
this as a patch on the tracker

http://sourceforge.net/tracker2/?group_id=80706

since I don't have time to review it right now and I don't want it to
fall through the cracks.

JDH

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] countour plot custom labels

2009-12-02 Thread Momme Butenschön
in the help for the countour plot labeling it says:
  *fmt*:
a format string for the label. Default is '%1.3f'
Alternatively, this can be a dictionary matching contour
levels with arbitrary strings to use for each contour level
(i.e., fmt[level]=string)
can somebody enlighten me how this works?
how do I connect levels to what dictionary keyword?

thank a lot,
Momme



  --
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Engineering prefixed units in tick labels

2009-12-02 Thread Matthias Michler
Hi Jason, Hi list,

First of all let me say I like the EngFormatter of Jason.
Are there plans to incorparate it into matplotlib? 
I cannot find any indication for this in current svn, but I would like to see 
the EngFormatter in matplotlib. Therefore I tried to include Jasons proposal 
into the ticker.py as a new class EngFormatter including the 
method 'self.format_eng'. 
I made some changes, which might break some of Jasons ideas, but I cannot see
(1) why we need the LogFormatter as base class instead of Formatter?
(2) why one should decide for only decade-labels. Therefore I removed the 
corresponding if-statement. It causes errors () if you use an axes 
including '0', which could be useful for eng-formatting, too.
(3) Could we always use  format_str = "%g %s"   instead of 
specifying 'places'? Because of successive zomming I don't want to 
specify 'places' before calling 'plt.show'. Therefore I introduced "places 
=None" to use "%g %s". 

I attached the new ticker.py and a diff against current svn (I'm sorry I 
couldn't resist to add some white spaces).

Any comments are welcome.

Kind regards,
Matthias Michler

On Wednesday 25 November 2009 01:39:43 Jason Heeris wrote:
> Hi,
>
> 2009/11/18 Jason Heeris :
> > In gnuplot, I can do the following:
> >
> > set format x "%.0s %cHz"
> >
> > ...and this will set the x-axis labels (on a semilogx style plot) to
> > be "10 Hz", "100 Hz", "1 kHz", "10 kHz", etc.
>
> I ended up implementing this myself, it wasn't too hard. I've attached
> the code if anyone else is interested. I don't know matplotlib that
> well, so I don't know if there's much duplication of code in there.
>
> I thought I'd CC the dev list in case others think it might be useful.
> If not, sorry for the noise.
>
> Cheers,
> Jason


Index: ticker.py
===
--- ticker.py	(revision 8000)
+++ ticker.py	(working copy)
@@ -118,6 +118,7 @@
 
 
 from __future__ import division
+import decimal
 import math
 import numpy as np
 from matplotlib import rcParams
@@ -507,23 +508,23 @@
 is ``False``
 """
 self._base = base+0.0
-self.labelOnlyBase=labelOnlyBase
+self.labelOnlyBase = labelOnlyBase
 self.decadeOnly = True
 
-def base(self,base):
+def base(self, base):
 'change the *base* for labeling - warning: should always match the base used for :class:`LogLocator`'
-self._base=base
+self._base = base
 
-def label_minor(self,labelOnlyBase):
+def label_minor(self, labelOnlyBase):
 'switch on/off minor ticks labeling'
-self.labelOnlyBase=labelOnlyBase
+self.labelOnlyBase = labelOnlyBase
 
 
 def __call__(self, x, pos=None):
 'Return the format for tick val *x* at position *pos*'
 vmin, vmax = self.axis.get_view_interval()
 d = abs(vmax - vmin)
-b=self._base
+b = self._base
 if x == 0.0:
 return '0'
 sign = np.sign(x)
@@ -533,13 +534,13 @@
 if not isDecade and self.labelOnlyBase: s = ''
 elif x>1: s= '%1.0e'%x
 elif x<1: s =  '%1.0e'%x
-else: s =  self.pprint_val(x,d)
+else: s =  self.pprint_val(x, d)
 if sign == -1:
 s =  '-%s' % s
 
 return self.fix_minus(s)
 
-def format_data(self,value):
+def format_data(self, value):
 self.labelOnlyBase = False
 value = cbook.strip_math(self.__call__(value))
 self.labelOnlyBase = True
@@ -554,14 +555,14 @@
 return abs(x-n)<1e-10
 
 def nearest_long(self, x):
-if x==0: return 0L
-elif x>0: return long(x+0.5)
+if x == 0: return 0L
+elif x > 0: return long(x+0.5)
 else: return long(x-0.5)
 
 def pprint_val(self, x, d):
 #if the number is not too big and it's an int, format it as an
 #int
-if abs(x)<1e4 and x==int(x): return '%d' % x
+if abs(x) < 1e4 and x == int(x): return '%d' % x
 
 if d < 1e-2: fmt = '%1.3e'
 elif d < 1e-1: fmt = '%1.3f'
@@ -572,7 +573,7 @@
 s =  fmt % x
 #print d, x, fmt, s
 tup = s.split('e')
-if len(tup)==2:
+if len(tup) == 2:
 mantissa = tup[0].rstrip('0').rstrip('.')
 sign = tup[1][0].replace('+', '')
 exponent = tup[1][1:].lstrip('0')
@@ -645,11 +646,106 @@
 if usetex:
 s = r'$%s%d^{%d}$'% (sign_string, b, self.nearest_long(fx))
 else:
-s = r'$\mathdefault{%s%d^{%d}}$'% (sign_string, b, self.nearest_long(fx))
+s = r'$\mathdefault{%s%d^{%d}}$'% (sign_string, b,
+   self.nearest_long(fx))
 
 return s
 
+class EngFormatter(Formatter):
+"""
+Formats axis values using engineering prefixes to represent powers of 1000,
+plus a specified unit, eg. 10 MHz instead of 1e7.
 
+example:
+  

Re: [Matplotlib-users] Computing Simple Statistics from a Histogram

2009-12-02 Thread Matthias Michler
Hi Wayne,

you are right all these function use the sample-data and not the pdf / 
frequency of occurence-histogram, because typically the data is available and 
not the pdf. Maybe the scipy mailing list could give you a solution to your 
problem.

In case that your freqency of occurence are integers you could do something 
like the following to generate the sample-data and than you the previous 
mentioned functions:
bin_centers = np.array([ 1.,  2.,  3.,  4.,  5.])
n_vals = np.array([1, 3, 0, 2, 1])
sample_new = np.array([])
for bin_center, n in zip(bin_centers, n_vals): 
# append new value 'n' times: 
sample_new = np.concatenate((sample_new, [bin_center]*n))

Kind regards,
Matthias

On Tuesday 01 December 2009 17:51:31 Wayne Watson wrote:
> I do not believe that any of those calculations are based on the pdf,
> frequency of occurrence-histogram. This, (1, 2,2, 4, 2,5,4) and not this
> (1,3, 0,2,1). The latter are the frequencies of occurrence for 1,2,3,4,5.
>
> John Hunter wrote:
> > On Tue, Dec 1, 2009 at 6:32 AM, Wayne Watson
> >
> >  wrote:
> >> Is there some statistics function that computes the mean, std. dev.,
> >> min/max, etc. from a frequency distribution?
> >
> > numpy has many functions for basic descriptive statistics.  If "data"
> > is an array of your data, you can do (import numpy as np)
> >
> > mean: np.mean(data)
> > median: np.median(data)
> > standard deviation: np.std(data)
> > min: np.min(data)
> > max: np.max(data)
> >
> > In scipy.stats, there are many more (skew, kurtosis, etc...)  See
> > also, this example:
> >
> >
> > http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/py4science/
> >examples/stats_descriptives.py?view=markup&pathrev=4027
> >
> > JDH



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users