Re: [Matplotlib-users] Bar plot choose colours

2015-10-29 Thread questions anon
panomaly.plot(kind='bar', color=colors) > > ​ > > On Thu, Oct 29, 2015 at 5:43 AM, questions anon > wrote: > >> Thanks for taking the time to respond >> >> I am receiving the error: >> AttributeError: 'Series' object has no attribute 'it

Re: [Matplotlib-users] Bar plot choose colours

2015-10-29 Thread questions anon
st comprehension over > the DataFrame > colors = ['r' if row.anomaly > 0 else 'b' for i, row in > meantempanomaly.iterrows()] > meantempanomaly.plot(kind='bar', color=colors) > > ​ > > On Wed, Oct 28, 2015 at 9:54 PM, questions anon > wrote

[Matplotlib-users] Bar plot choose colours

2015-10-28 Thread questions anon
I have calculated annual temperature anomaly and I would like to plot as a bar plot with all values positive make red and all values negative make blue I am using pandas and the time series data in this example are called 'anomaly' mybarplot=anomaly.plot(kind='bar') the data look like this: tim

Re: [Matplotlib-users] dates for x-axis

2012-04-23 Thread questions anon
AM, Benjamin Root wrote: > > > On Thu, Apr 19, 2012 at 1:21 PM, Goyo wrote: > >> El día 19 de abril de 2012 05:31, questions anon >> escribió: >> > Thank you, I was able to get it to work but only if I imported datetime >> > within the loop, otherwi

Re: [Matplotlib-users] dates for x-axis

2012-04-18 Thread questions anon
a=mdates.DateFormatter('%Y%m') ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y%m')) plt.xlabel("year-month") plt.ylabel("Precipitation (mm)") plt.title("Max monthly precipition") plt.savefig(OutputFolder+"MaxMonthlyPrecip.png") plt.sh

Re: [Matplotlib-users] dates for x-axis

2012-04-17 Thread questions anon
'%Y%m') ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y%m')) plt.xlabel("year-month") plt.ylabel("Precipitation (mm)") plt.title("Max monthly Precipition") plt.savefig(OutputFolder+"MaxMonthlyPrecip.png") plt.show() On Fri, Apr 13

[Matplotlib-users] dates for x-axis

2012-04-11 Thread questions anon
Hi matplotlib list, I am having trouble applying mdates in matplotlib. I am not sure how to recognise that x-axis are dates like 20110101, 20110102, 20110103 etc. Any feedback will be greatly appreciated! below is the code I have so far: import numpy as np import matplotlib.pyplot as plt from nump

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-25 Thread questions anon
excellent, thanks, that worked and was able to plot using matplotlib without ending up with the logical_or error. thanks everyone On Thu, Mar 22, 2012 at 3:59 AM, Goyo wrote: > El día 21 de marzo de 2012 01:03, questions anon > > > f=np.genfromtxt(inputfile, skip_header=6, dtype

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-20 Thread questions anon
0.0)] f shape: (690,) f dtype: [('0', ' print "f dtype: ", f.dtype[1:2] ValueError: Field key must be an integer, string, or unicode. On Wed, Mar 21, 2012 at 1:47 AM, Benjamin Root wrote: > > > On Mon, Mar 19, 2012 at 5:28 PM, questions anon > wrote: > &g

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-19 Thread questions anon
Error: total size of new array must be unchanged Is there a way to use np.genfromtxt and define the rows and columns on import? Thanks On Fri, Mar 16, 2012 at 7:10 AM, Goyo wrote: > El día 15 de marzo de 2012 05:14, questions anon > escribió: > > I think my error is from the np.genfr

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-14 Thread questions anon
do I skip those first few rows but still end up with a 2D array? On Thu, Mar 15, 2012 at 12:16 PM, questions anon wrote: > I don't really understand what np.logical_or is or how to use it? > I have tried just calling it at the beginning of the script but I still > end up with the sam

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-14 Thread questions anon
Mar 13, 2012 at 4:23 PM, questions anon > wrote: > >> also I have tried running it on a different computer and the same error >> occurred >> >> >> On Wed, Mar 14, 2012 at 8:22 AM, questions anon > > wrote: >> >>> thanks for looking into this Goyo. >

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-13 Thread questions anon
also I have tried running it on a different computer and the same error occurred On Wed, Mar 14, 2012 at 8:22 AM, questions anon wrote: > thanks for looking into this Goyo. > The complete code: > > > import numpy as N > import matplotlib.pyplot as plt > from numpy i

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-13 Thread questions anon
=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 Any feedback/ideas will be greatly appreciated. On Wed, M

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-12 Thread questions anon
an ascii to a numpy array? thanks On Fri, Mar 9, 2012 at 5:27 PM, Benjamin Root wrote: > > > On Wednesday, March 7, 2012, questions anon > wrote: > > Hi all, > > I am still having a problem with the same code. I am not sure if maybe > the problem is how I read the

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-07 Thread questions anon
Hi all, I am still having a problem with the same code. I am not sure if maybe the problem is how I read the data in as numpy.genfromtxt Is there a step I need to take to convert the data to numpy array to then read into matplotlib? Thanks On Fri, Mar 2, 2012 at 11:49 AM, questions anon wrote

Re: [Matplotlib-users] open ascii grid data and plot

2012-03-01 Thread questions anon
os On Thu, Mar 1, 2012 at 4:42 PM, Benjamin Root wrote: > > > 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

Re: [Matplotlib-users] open ascii grid data and plot

2012-02-29 Thread questions anon
-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

[Matplotlib-users] open ascii grid data and plot

2012-02-29 Thread questions anon
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 latitu

Re: [Matplotlib-users] add cirlce around lat lon

2011-12-07 Thread questions anon
6 Dec 2011 21:23:18 -0600 > From: ben.r...@ou.edu > To: questions.a...@gmail.com > CC: Matplotlib-users@lists.sourceforge.net > Subject: Re: [Matplotlib-users] add cirlce around lat lon > > > > > On Tuesday, December 6, 2011, questions anon > wrote: > > I would li

[Matplotlib-users] add cirlce around lat lon

2011-12-06 Thread questions anon
I would like to draw a simple circle around a specified latitude and longitude but I cannot find an appropriate command. I have tried using map.drawgreatcircle(myLON, myLAT,myLON, myLAT, linewidth=20,color='k') but this doesn't do anything or even map.drawgreatcircle(myLON+1, myLAT+1,myLON-1, myLAT

Re: [Matplotlib-users] use shapefile to create a mask?

2011-11-08 Thread questions anon
thanks, will look at these options. On Fri, Nov 4, 2011 at 10:21 AM, Matt S. wrote: > I've used Pyshapelib and Polygon to do this type of analysis in the past. > Thuban may get ya what you need. > > On Thu, Nov 3, 2011 at 3:40 PM, questions anon > wrote: > >>

Re: [Matplotlib-users] Warning: converting a masked element to nan

2011-11-06 Thread questions anon
** > > *From:* questions anon [mailto:questions.a...@gmail.com] > *Sent:* Wednesday, November 02, 2011 17:17 > > Thanks, I think you are right about the datetimes for the x axis causing > the problem. > Does anyone have any ideas how to resolve this? > > Does it help to c

[Matplotlib-users] use shapefile to create a mask?

2011-11-03 Thread questions anon
Hi All, Is there a way to select only the values within a particular shapefile to analyse. I would like to do something like: array=numpyarraycoveringtemperatureofwholestate shapefile=forestedregions.shp newarray=ma.masked_values(array, shapefile) meantemperatureofforestedregions=MA.mean(newarray

Re: [Matplotlib-users] Warning: converting a masked element to nan

2011-11-02 Thread questions anon
nd arrays with NaNs and >> treat both the same. Can you reduce the script to something that can be >> run independently without data? It's not clear to me yet why this is >> failing. >> >> Mike >> >> >> On 11/01/2011 05:24 PM, questions an

[Matplotlib-users] Warning: converting a masked element to nan

2011-11-01 Thread questions anon
Hi All, I am trying to plot time against mean daily temperature values. The problem is temperature contains no data in a few areas. I want to be able to ignore this and continue plotting. When I run the below script on my data that has all normal numbers it works fine but when I run the script on m

Re: [Matplotlib-users] memory error - netcdf plots

2011-10-23 Thread questions anon
Thanks Jeff! On Thu, Oct 20, 2011 at 1:16 PM, Jeff Whitaker wrote: > On 10/19/11 4:37 PM, questions anon wrote: > > thank you, I am not quite sure how to 'draw' the shapefile > > from matplotlib.collections import LineCollection > ax =

Re: [Matplotlib-users] memory error - netcdf plots

2011-10-19 Thread questions anon
thank you, I am not quite sure how to 'draw' the shapefile but making those changes and removing the shapefile has sped the processing up considerably! Thank you for your help On Wed, Oct 19, 2011 at 11:42 PM, Jeff Whitaker wrote: > On 10/18/11 8:55 PM, questions anon wrote: &g

Re: [Matplotlib-users] memory error - netcdf plots

2011-10-18 Thread questions anon
/11 8:20 PM, questions anon wrote: > > Hi All, > I keep receiving a memory error when processing many netcdf files. I > assumed it had something to do with how I loop things and maybe needed to > close things off properly but I recently received an error that made me > think i

Re: [Matplotlib-users] plot arrows for wind direction (degrees)

2011-10-13 Thread questions anon
for the responses. On Fri, Oct 14, 2011 at 9:32 AM, Eric Firing wrote: > On 10/13/2011 12:22 PM, Benjamin Root wrote: > >> >> >> On Thursday, October 13, 2011, questions anon > <mailto:questions.anon@gmail.**com >> wrote: >> > Another quick questio

Re: [Matplotlib-users] plot arrows for wind direction (degrees)

2011-10-13 Thread questions anon
gative to account for southern hemisphere v=-1*N.cos(WDIR*N.pi/180) map.quiver(x,y,u, v) On Wed, Oct 5, 2011 at 3:20 PM, questions anon wrote: > thank you! of course! > > > On Wed, Oct 5, 2011 at 3:08 PM, Eric Firing wrote: > >> On 10/04/2011 05:40

[Matplotlib-users] memory error - netcdf plots

2011-10-12 Thread questions anon
Hi All, I keep receiving a memory error when processing many netcdf files. I assumed it had something to do with how I loop things and maybe needed to close things off properly but I recently received an error that made me think it might be because of matplotlib. In the code below I am looping thr

Re: [Matplotlib-users] plot arrows for wind direction (degrees)

2011-10-04 Thread questions anon
thank you! of course! On Wed, Oct 5, 2011 at 3:08 PM, Eric Firing wrote: > On 10/04/2011 05:40 PM, questions anon wrote: > > Excellent, thank you. That works for both quiver and barb. > > In regards to the shape that has to do with the netcdf file, wind > > direction vari

Re: [Matplotlib-users] plot arrows for wind direction (degrees)

2011-10-04 Thread questions anon
th is > 0, South is 180, etc, so that should all be assigned already. > > It also looks like you have an array size mis-match, can you print > LAT.shape, LON.shape,TIME.shape,WDIR.shape it may be that your lat,lon > variables also need to be subset to [-50]? > > hope this helps, &g

Re: [Matplotlib-users] plot arrows for wind direction (degrees)

2011-10-04 Thread questions anon
ept for d_0 On Tue, Oct 4, 2011 at 12:54 PM, Eric Firing wrote: > On 10/03/2011 03:00 PM, Benjamin Root wrote: > > On Mon, Oct 3, 2011 at 6:51 PM, questions anon > <mailto:questions.a...@gmail.com>> wrote: > > > > Hi All, > > Is there a simple way to pl

[Matplotlib-users] plot arrows for wind direction (degrees)

2011-10-03 Thread questions anon
Hi All, Is there a simple way to plot a directional arrow to represent a degree? I have a netcdf file containing wind direction as degrees and I would like to make a plot with all little arrows representing the wind direction. Below is the code I am using currently to plot wind direction but am not

[Matplotlib-users] histogram of mean & SD

2009-08-18 Thread questions anon
Can anyone explain how I could: -Open two shapefiles -Open a raster -Plot a histogram of the values within each shapefile on the same plot and display the mean and Standard Deviation of each plot. Thanks -- Let Crystal