Re: [Matplotlib-users] how to make a polar plot just of a section with grid

2010-10-21 Thread Stefan Mauerberger
Hi Frederick, 

thanks for your answer. The option *faceted* I already knew but this is
not exactly what I want. Perhaps it would be possible to draw the grid
without labels. 

My goal is to draw a grid with labels above the data. Similar to the
example 'demo curvelinear grid'. 

Regards 

Stefan 


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] range in the colorbar

2010-10-21 Thread Alexander Dietz
Hi,

I am generating a scatter plot with a colorbar, and want to pass on the
colorbar to some function to do something with it, like

plt.scatter(px, py, c=pz, ...)
cb = plt.colorbar()
foo(cb)


My question: How can I extract the range of the colorbar from the cb object?
The colorbar extends from min(pz) to max(pz), but can I access these values
from the cb object alone, without the need to pass pz to foo as well?


Thanks
  Alex
--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] installation question

2010-10-21 Thread Bala subramanian
Friends,
I am using mpl in fedora10. I installed mpl (version 0.98.5.2) with yum
previously. Since yum does not upgrade to latest mpl version, i have
downloaded the tarball to install from the source. Now i want to install mpl
in the same location as previously done by yum (info. given below).

1) How can force the installation to the same location as done by yum.

2) Will there be anyproblem if i overwrite old one with new installation.

 import matplotlib
 matplotlib.__version__
'0.98.5.2'
 matplotlib.__file__
'/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc'


Thank you,
Bala
--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation question

2010-10-21 Thread Filipe Pires Alvarenga Fernandes
Hi Bala,

Strange that yum did not updated, Fedora does has the latest version packaged:

http://koji.fedoraproject.org/koji/packageinfo?packageID=3607


Maybe you can try to force the installation of the latest rpm by
downloading it and installing it with yum.

*
Filipe Pires Alvarenga Fernandes, PhD Candidate
School of Marine Science and Technology
University of Massachusetts at Dartmouth
706 Rodney French Blvd., New Bedford, MA 02744

Email: falvarengafernan...@umassd.edu
          ocef...@gmail.com

http://ocefpaf.tiddlyspot.com/
*



On Thu, Oct 21, 2010 at 06:46, Bala subramanian
bala.biophys...@gmail.com wrote:
 Friends,
 I am using mpl in fedora10. I installed mpl (version 0.98.5.2) with yum
 previously. Since yum does not upgrade to latest mpl version, i have
 downloaded the tarball to install from the source. Now i want to install mpl
 in the same location as previously done by yum (info. given below).

 1) How can force the installation to the same location as done by yum.

 2) Will there be anyproblem if i overwrite old one with new installation.

 import matplotlib
 matplotlib.__version__
 '0.98.5.2'
 matplotlib.__file__
 '/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc'


 Thank you,
 Bala

 --
 Nokia and ATT present the 2010 Calling All Innovators-North America contest
 Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
 $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
 Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
 http://p.sf.net/sfu/nokia-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Changing the axis that colour changes with in surface plots

2010-10-21 Thread Matt46

Hi everybody,

I have been using the plot_surface function to create excellent 3d surface
plots. However, the colour scales with the z axis, and I cannot find any way
to change this. Specifically, I am interested in making the colour change
with distance from the origin - in other words, so that it scales with
(x^2+y^2+z^2)^1/2. Is there any way of doing this in matplotlib?

Thanks,
Matt 
-- 
View this message in context: 
http://old.nabble.com/Changing-the-axis-that-colour-changes-with-in-surface-plots-tp30018631p30018631.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to make a polar plot just of a section with grid

2010-10-21 Thread Friedrich Romstedt
2010/10/21 Stefan Mauerberger stefan.mauerber...@mnet-online.de:
 My goal is to draw a grid with labels above the data. Similar to the
 example 'demo curvelinear grid'.

Ok, I think I cannot give you an authoritative response here, but the
following might be useful for the labels:

http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.text

From first glimple, I don't understand
http://matplotlib.sourceforge.net/examples/axes_grid/demo_curvelinear_grid.html
either.  It assumes a lot of knowledge of the techniques used imo.

As a conclusion, I predict that this plot can easily grow to middle
complexity, and that it might be worth using PolarAxes with grid
turned off, and maybe save it as svg and remove the circle or sth like
that.  AFAIK, lines in PolarAxes are automatically bended, so the grid
shouln't be a problem (you may use some pcolor function with nans in
the values, so that only the grid is drawn)

You can override the PolarAxes locator and ticklabels.

Friedrich

--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Plot Minor Tweaking

2010-10-21 Thread Lorenzo Isella
Dear All,
Please consider the snippet at the end of the email.
Admittedly, I am still quite cumbersome with the matplotlib pipeline (I 
am a bit unsure about how to manipulate objects and their properties).
The snippet below produces two plots. I have some questions
(1) for both plots: how do I add some text to the plot(possibly in 
latex) in a specified position and fine-tune its properties (size, bold 
etc...)?
(2) Last generated plot: I would like to have arrows like in the 
previous plot, just rotated by 90 degrees so that they hit the red areas 
at the north and south poles. However, this does not look possible right 
now without shortening the arrows (there is not enough vertical space; 
somehow the whole aspect ratio of the plot+boundary is not 1). Any 
suggestions about how to fix this?

Many thanks


Lorenzo


33

  #!/usr/bin/env python

See pcolor_demo2 for a much faster way of generating pcolor plots

from __future__ import division
from pylab import *

def func3(x,y):
return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)


def func4(x,y):
theta=arcsin(y)
return cos(theta)

def func5(x,y):

return abs(sin(y))

def func6(x,y):

return abs(cos(y))


# make these smaller to increase the resolution
dx, dy = 0.05, 0.05

# x = arange(-1.0, 1.0, dx)
# y = arange(-1.0, 1.0, dy)

x = arange(-pi/2., pi/2., dx)
y = arange(-pi/2., pi/2., dy)


X,Y = meshgrid(x, y)

Z = func6(X, Y)

# print Z is, , Z


ini=pi/2.+0.5

ax = subplot(111)
ax.axis('off')



im = imshow(Z,cmap=cm.jet, extent=(-pi/2., pi/2., -pi/2., pi/2.))
im.set_interpolation('bilinear')

im.set_clip_path(Circle((0,0),pi/2., transform=ax.transData))

annotate(, xy=(-pi/2., 0), xytext=(-ini, 0), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., .2), xytext=(-ini, .2), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., -.2), xytext=(-ini, -.2), arrowprops=dict(fc=g))

annotate(, xy=(-pi/2., .4), xytext=(-ini, .4), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., -.4), xytext=(-ini, -.4), arrowprops=dict(fc=g))


annotate(, xy=(-pi/2., .6), xytext=(-ini, .6), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., -.6), xytext=(-ini, -.6), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., .8), xytext=(-ini, .8), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., -.8), xytext=(-ini, -.8), arrowprops=dict(fc=g))


annotate(, xy=(-pi/2., 1), xytext=(-ini, 1), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., -1), xytext=(-ini, -1), arrowprops=dict(fc=g))

annotate(, xy=(-pi/2., 1.2), xytext=(-ini, 1.2), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., -1.2), xytext=(-ini, -1.2), 
arrowprops=dict(fc=g))

annotate(, xy=(-pi/2., 1.4), xytext=(-ini, 1.4), arrowprops=dict(fc=g))
annotate(, xy=(-pi/2., -1.4), xytext=(-ini, -1.4), 
arrowprops=dict(fc=g))



annotate(, xy=(pi/2., 0), xytext=(ini, 0), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., .2), xytext=(ini, .2), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., -.2), xytext=(ini, -.2), arrowprops=dict(fc=g))

annotate(, xy=(pi/2., .4), xytext=(ini, .4), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., -.4), xytext=(ini, -.4), arrowprops=dict(fc=g))


annotate(, xy=(pi/2., .6), xytext=(ini, .6), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., -.6), xytext=(ini, -.6), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., .8), xytext=(ini, .8), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., -.8), xytext=(ini, -.8), arrowprops=dict(fc=g))


annotate(, xy=(pi/2., 1), xytext=(ini, 1), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., -1), xytext=(ini, -1), arrowprops=dict(fc=g))

annotate(, xy=(pi/2., 1.2), xytext=(ini, 1.2), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., -1.2), xytext=(ini, -1.2), arrowprops=dict(fc=g))

annotate(, xy=(pi/2., 1.4), xytext=(ini, 1.4), arrowprops=dict(fc=g))
annotate(, xy=(pi/2., -1.4), xytext=(ini, -1.4), arrowprops=dict(fc=g))



savefig(first-plot.pdf)

clf()



Z = func5(X, Y)


ax = subplot(111,aspect='equal')
ax.axis('off')



im = imshow(Z,cmap=cm.jet, extent=(-pi/2., pi/2., -pi/2., pi/2.))
im.set_interpolation('bilinear')

im.set_clip_path(Circle((0,0),pi/2., transform=ax.transData))

annotate(, xy=(pi/2., 0), xytext=(ini, 0), arrowprops=dict(fc=g))

annotate(, xy=(0., -1.6), xytext=(ini, 0), arrowprops=dict(fc=g))





savefig(second-plot.pdf)

clf()



--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] range in the colorbar

2010-10-21 Thread Eric Firing
On 10/20/2010 11:41 PM, Alexander Dietz wrote:
 Hi,

 I am generating a scatter plot with a colorbar, and want to pass on the
 colorbar to some function to do something with it, like

 plt.scatter(px, py, c=pz, ...)
 cb = plt.colorbar()
 foo(cb)


 My question: How can I extract the range of the colorbar from the cb
 object? The colorbar extends from min(pz) to max(pz), but can I access
 these values from the cb object alone, without the need to pass pz to
 foo as well?

cb.norm.vmin
cb.norm.vmax

Or you can get the same thing from the collection returned by scatter:

col = scatter(...)
col.norm.vmin
col.norm.vmax

The colorbar uses the norm and colormap from the current image (or more 
generally, the color-mappable object), which in this case is the 
collection generated by scatter().

Eric



 Thanks
Alex



 --
 Nokia and ATT present the 2010 Calling All Innovators-North America contest
 Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
 $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
 Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
 http://p.sf.net/sfu/nokia-dev2dev



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


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] merge two axes

2010-10-21 Thread Ruggero
Suppose I have two functions returning axes:


def f1():
f = plt.figure()
ax = f.add_axes(111)
ax.plot()
ax.lengend()
return ax

def f2():
similar to f1

now I have a figure

main_fig = plt.fig()

I want to merge axes from f1 and f2 in a unique axes (withou splitting
the figure). For example if f1 produces a line and f2 produces another
line I want to see two lines in the same plot at the end.

--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users