Re: [Matplotlib-users] Bar plot choose colours

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

Re: [Matplotlib-users] Bar plot choose colours

2015-10-29 Thread questions anon
list 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 <questions.a...@gmail.com> &

[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:

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

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

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

2012-04-18 Thread questions anon
')) plt.xlabel(year-month) plt.ylabel(Precipitation (mm)) plt.title(Max monthly Precipition) plt.savefig(OutputFolder+MaxMonthlyPrecip.png) plt.show() On Fri, Apr 13, 2012 at 2:31 AM, Goyo goyod...@gmail.com wrote: El día 12 de abril de 2012 03:46, questions anon questions.a...@gmail.com escribió: I

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

2012-04-18 Thread questions anon
(Precipitation (mm)) plt.title(Max monthly precipition) plt.savefig(OutputFolder+MaxMonthlyPrecip.png) plt.show() On Thu, Apr 19, 2012 at 2:52 AM, Goyo goyod...@gmail.com wrote: El día 18 de abril de 2012 07:59, questions anon questions.a...@gmail.com escribió: I am not exactly sure how to use

[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

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 goyod...@gmail.com 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
): File d:/BoMdata/plotrainfall_v3.py, line 10, in module 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 ben.r...@ou.edu wrote: On Mon, Mar 19, 2012 at 5:28 PM, questions anon questions.a

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

2012-03-19 Thread questions anon
: 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 goyod...@gmail.com wrote: El día 15 de marzo de 2012 05:14, questions anon questions.a...@gmail.com escribió: I think my error

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

2012-03-14 Thread questions anon
PM, questions anon questions.a...@gmail.comwrote: 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 questions.a...@gmail.com wrote: thanks for looking into this Goyo. The complete code: import numpy as N

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

2012-03-14 Thread questions anon
but still end up with a 2D array? On Thu, Mar 15, 2012 at 12:16 PM, questions anon questions.a...@gmail.comwrote: 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 same error. On Thu, Mar

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

2012-03-13 Thread questions anon
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, Mar 14, 2012 at 4:59 AM, Goyo goyod...@gmail.com wrote: El día 12 de marzo de 2012 23:25, questions anon questions.a

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 questions.a...@gmail.comwrote: thanks for looking into this Goyo. The complete code: import numpy as N import matplotlib.pyplot as plt from numpy import ma

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 ben.r...@ou.edu wrote: On Wednesday, March 7, 2012, questions anon questions.a...@gmail.com 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

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 ben.r...@ou.edu 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 receiving is: Traceback

[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

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

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

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

2011-12-07 Thread questions anon
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 questions.a...@gmail.com wrote: I would like to draw a simple circle around a specified latitude and longitude but I cannot

[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,

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. sleepingb...@gmail.com 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 questions.a

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 call ax.xaxis_date() before your

[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)

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

2011-11-02 Thread questions anon
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 anon wrote: Hi All, I am trying to plot time against mean daily temperature values. The problem

[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

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 jsw...@fastmail.fm 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 = plt.gca() # get

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 jsw...@fastmail.fm wrote: On 10/18/11 8:55 PM, questions anon wrote

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

2011-10-18 Thread questions anon
wrote: On 10/12/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 it might

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

2011-10-13 Thread questions anon
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 questions.a...@gmail.comwrote: thank you! of course! On Wed, Oct 5, 2011 at 3:08 PM, Eric Firing efir...@hawaii.edu wrote: On 10/04/2011 05:40 PM, questions anon

[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

[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

[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