Federico Ariza | 1 Mar 2012 01:09
Picon

impossible to deactivate minor grid in logscale

Hi

If I set the scale to log and set the grid to minor
then, it is impossible to deactivate the grid
It does not happen with major or without the logscale

The code to reproduce the problem


import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(100), range(100))

#If comment the following line everything is fine
ax.set_xscale('log')

xaxis = ax.get_xaxis()
xaxis.grid(which = 'Minor')
xaxis.grid(False)
plt.show()


Thanks
Federico
--
Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?

-- Antonio Alducin --

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
questions anon | 1 Mar 2012 06:16
Picon

Re: open ascii grid data and plot

I have had some progress reading in the data but am unsure how to create lats and lons from the info I have (see above).
the error I am receiving is:

Traceback (most recent call last):
  File "d:\plotrainfall.py", line 40, in <module>
    CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
  File "C:\Python27\lib\site-packages\mpl_toolkits\basemap\__init__.py", line 3072, in contourf
    np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
AttributeError: logical_or


from the below code:


onefile=r"E:/test_in/r19000117.txt"

f=N.genfromtxt(onefile, skip_header=6,  dtype=float, names=True)
print f


map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9,
              llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i')
map.drawcoastlines()
map.drawstates()
xi=N.linspace(111.975, 156.275, 886)
yi=N.linspace(-44.525, -9.975, 691)
x,y=map(*N.meshgrid(xi,yi))
plt.title('rainfall')
CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
l,b,w,h =0.1,0.1,0.8,0.8
cax = plt.axes([l+w+0.025, b, 0.025, h])
plt.colorbar(CS,cax=cax, drawedges=True)
plt.savefig((os.path.join(OutputFolder, 'rainfall.png')))
plt.show()
plt.close()




On Thu, Mar 1, 2012 at 9:29 AM, questions anon <questions.anon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I have a txt file (with an associated prj file) containing gridded weather data.
Firstly how can I open this file and convert it to a numpy array?
and then how to plot in matplotlib, paticularly how to use the lat, lon and nrows,ncols.
ncols=886
nrows=691
longitude west=111.975, east=156.275
latitude north=-9.975, south=-44.525
cell size=0.05

My attempt below:
--------------------------------------------------

onefile=open("E:/test_in/r19000117.txt", 'r')

map = Basemap(projection='merc',llcrnrlat=-40,urcrnrlat=-33,
              llcrnrlon=139.0,urcrnrlon=151.0,lat_ts=0,resolution='i')
map.drawcoastlines()
map.drawstates()
xi=N.linspace(111.975, 156.275, 886)
yi=N.linspace(-44.525, -9.975, 691)
x,y=map(*N.meshgrid(xi,yi))
plt.title('rainfall')
CS = map.contourf(x,y, onefile, cmap=plt.cm.jet)
l,b,w,h =0.1,0.1,0.8,0.8
cax = plt.axes([l+w+0.025, b, 0.025, h])
plt.colorbar(CS,cax=cax, drawedges=True)
plt.savefig((os.path.join(OutputFolder, 'rainfall.png')))
plt.show()
plt.close()


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Benjamin Root | 1 Mar 2012 06:42
Picon
Favicon

Re: open ascii grid data and plot



On Wednesday, February 29, 2012, questions anon wrote:
I have had some progress reading in the data but am unsure how to create lats and lons from the info I have (see above).
the error I am receiving is:

Traceback (most recent call last):
  File "d:\plotrainfall.py", line 40, in <module>
    CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
  File "C:\Python27\lib\site-packages\mpl_toolkits\basemap\__init__.py", line 3072, in contourf
    np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
AttributeError: logical_or


from the below code:


onefile=r"E:/test_in/r19000117.txt"

f=N.genfromtxt(onefile, skip_header=6,  dtype=float, names=True)
print f


map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9,
              llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i')
map.drawcoastlines()
map.drawstates()
xi=N.linspace(111.975, 156.275, 886)
yi=N.linspace(-44.525, -9.975, 691)
x,y=map(*N.meshgrid(xi,yi))
plt.title('rainfall')
CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
l,b,w,h =0.1,0.1,0.8,0.8
cax = plt.axes([l+w+0.025, b, 0.025, h])
plt.colorbar(CS,cax=cax, drawedges=True)
plt.savefig((os.path.join(OutputFolder, 'rainfall.png')))
plt.show()
plt.close()



How did you install numpy?  Which version are you using?  What are your imports at the top of this script?

Ben Root
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Mic | 1 Mar 2012 09:14
Picon

Google Summer of Code

Hello,

Is it possible to use PyPy with:
* BioPython
* Pysam
* Matplotlib
* etc

If not than it might be good idea to get a support for it with help of Google Summer of Code, because PyPy getting faster and faster.

Cheers,
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Jean-Baptiste Marquette | 1 Mar 2012 10:39
Picon
Favicon

Re: open ascii grid data and plot


Le 29 févr. 2012 à 23:29, questions anon a écrit :

I have a txt file (with an associated prj file) containing gridded weather data.
Firstly how can I open this file and convert it to a numpy array?

You should have a look on ATpy package : http://atpy.github.com/

Cheers
JB
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
John Hunter | 1 Mar 2012 15:06
Picon
Gravatar

pydata hack Friday night in Santa Clara

I'll be attending the pydata hack night in Santa Clara tomorrow night.  We'll be hacking on matplotlib, ipython, pandas, numpy and more.  If you are interested in stopping by, there is space for 200, many more than the number of attendees at pydata.  The event info is here:



Here is the description from the event:

The Python Data Workshop just got bigger!  We are thrilled to announce that Ground Floor Silicon Valley is generously opening up their coworking space and hosting a Friday night Python Data Hack Night for all attendees of the Workshop and any others who want to geek out on Python, data analysis, and scientific computing!  Spend a fun evening eating, drinking, coding, and talking shop with the instructors and participants of the Workshop.  This includes the authors of Numpy, Scipy, IPython, Matplotlib, PyTables, Pandas, and many other great Python packages.

Ground Floor has room for up to 200 folks, so if you are on the wait list for the full Workshop, this is your chance to participate in the workshop!  We are making tickets available to all those who registered for the Python Data Workshop (attendees and wait list), before publicizing the event more widely, so sign up now!

The event runs from 6pm until Midnight.  
We are looking for sponsors to cover food and drinks, but we do expect to have those there.
For sponsorship details, contact lynnbender-1YRSmsmfLLe0fEd0lbWiZA@public.gmane.org

Ground Floor SV
2030 Duane Avenue 
Santa Clara, CA 95054

Friday, March 2, 2012 from 6:00 PM to 11:55 PM (PT)


JDH
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Bernhard Heijstek | 1 Mar 2012 03:00
Picon
Favicon

Does matplotlib.animation module use weakrefs?

Hello,

I'm trying to run a rudimentary animation code (http://pastebin.com/ZNRhDmPR). When I don't explicitly
give a name to the FuncAnimation object, the code doesn't work. I mean, just dropping in:
anim.FuncAnimation(fig, update_figure, np.arange(0, 2*np.pi, 0.1), interval=50)

instead of,

line_anim = anim.FuncAnimation(fig, update_figure, np.arange(0, 2*np.pi, 0.1), interval=50)

The way I see it, since both call the constructor and I don't reuse the object anywhere else, both should
work, unless the code uses some weakrefs somewhere. If not, why isn't it working?

Thanks!

Bernhard.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Ryan May | 1 Mar 2012 15:18
Picon
Gravatar

Re: Does matplotlib.animation module use weakrefs?

On Feb 29, 2012, at 20:00, Bernhard Heijstek
<bernhard.heijstek@...> wrote:

> Hello,
> 
> I'm trying to run a rudimentary animation code (http://pastebin.com/ZNRhDmPR). When I don't
explicitly give a name to the FuncAnimation object, the code doesn't work. I mean, just dropping in:
> anim.FuncAnimation(fig, update_figure, np.arange(0, 2*np.pi, 0.1), interval=50)
> 
> instead of,
> 
> line_anim = anim.FuncAnimation(fig, update_figure, np.arange(0, 2*np.pi, 0.1), interval=50)
> 
> The way I see it, since both call the constructor and I don't reuse the object anywhere else, both should
work, unless the code uses some weakrefs somewhere. If not, why isn't it working?

When you don't give the animation object a name, immediately following creation nothing is referencing
the animation, so it is destroyed.

Ryan
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Jean-Baptiste Marquette | 1 Mar 2012 17:59
Picon
Favicon

matplotlib hanging on Mac OS 10.7 with Python 2.7.2 EPD 7.2-2 (64-bit)

Dear Python gurus,

I have written the attached script to plot data from SAMP interaction with TOPCAT (http://www.star.bris.ac.uk/~mbt/topcat/).
I select a row on a given table (VOtable format) in TOPCAT, got the message

Selected : file:/Volumes/pepperland/erosdata/cc_all/tm_all.vot 18
Plotting star tm5000k7768

All I obtain on screen is a blank rectangle window without borders and the rainbow wheel. I sampled the
python process, file attached as well.
I updated PyQt4 using the latest Mac snapshot and the Qt 4.8 libraries.

Any hint welcome, thanks.

Cheers,
Jean-Baptiste Marquette

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Pawel | 1 Mar 2012 18:33
Picon

xtick labels size and positions

Hi all,

Is it possible to set the size of only some tick labels? I have text 
tick labels (residue names). I'd like to reduce the font size of just 
two of the labels to make them fit better, but keep the size of the 
remaining labels the same.

And in a similar vein, is it possible to change the padding of just some 
tick labels? Again, I'd like to increase the padding of just two of the 
labels but keep the remaining the same.

Thanks for the help,
Pawel Janowski

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

Gmane