Re: [Matplotlib-users] edge joinstyle on rectangles

2011-09-06 Thread Michael Droettboom
On 08/31/2011 01:20 PM, Eric Firing wrote:
 On 08/31/2011 06:45 AM, Jeffrey Blackburne wrote:
 Hi,

 Are the edges of the rectangles returned by plt.bar() supposed to conform to 
 the 'lines.solid_joinstyle' rcParam? If not, is there another method for 
 specifying that joinstyle?

 I have not been able to change the joinstyle using this method in versions 
 1.0.0 (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a minimal 
 example script if requested.

 The bar rectangles are Patch object outlines, not Line2D objects, and
 solid_joinstyle is not presently supported by patches, as far as I can see.


I suppose it probably should be supported, though.  Do you agree?

Mike

-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib

2011-09-06 Thread Michael Droettboom
On 08/31/2011 11:21 PM, Eric Firing wrote:
 On 08/31/2011 01:59 PM, Benjamin Root wrote:
 On Wed, Aug 31, 2011 at 6:35 PM, Craig Finchcfi...@ieee.org
 mailto:cfi...@ieee.org  wrote:

  I figured it out!  I accidentally did something weird.  When I built
  NumPy and SciPy, I used the --user option to tell distutils to build
  them in my home directory. I had not realized that --user installs
  the packages in ~/.local/lib/python2.7/site-packages/.  I was
  assuming they would be installed in ~/lib/python2.7/site-packages,
  but I didn't notice they were missing until just now.  When I
  reinstalled NumPy and Scipy using the option --prefix=/home/cfinch
  and then rebuilt matplotlib, everything started working.  I didn't
  have to rebuild pycairo or pygtk; I just had to get everything in
  the same location.  This is the first I've heard of installing
  anything in a .local directory...why is that even an option???

  Thanks for your help!


 It is a standard directory in linux now.  Started by the freedesktop.org
 http://freedesktop.org, I think.  Personally, I prefer it over having
 ~/lib, ~/bin and such cluttering my home directory.

 http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
 Aha!  So that's where .config came from, also.  IPython is using it; I
 suppose we should, too.

I've created a github issue to discuss and/or implement this here:

https://github.com/matplotlib/matplotlib/issues/454

Mike

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] edge joinstyle on rectangles

2011-09-06 Thread Jeffrey Blackburne
On Sep 6, 2011, at 10:48 AM, Michael Droettboom wrote:
On 08/31/2011 01:20 PM, Eric Firing wrote:
 On 08/31/2011 06:45 AM, Jeffrey Blackburne wrote:
 Hi,

 Are the edges of the rectangles returned by plt.bar() supposed to conform
 to the 'lines.solid_joinstyle' rcParam? If not, is there another method for
 specifying that joinstyle?

 I have not been able to change the joinstyle using this method in versions 
 1.0.0
 (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a minimal 
 example
script if requested.

 The bar rectangles are Patch object outlines, not Line2D objects, and
 solid_joinstyle is not presently supported by patches, as far as I can see.


I suppose it probably should be supported, though.  Do you agree?

It would be nice to have. Since the patch edge seemed to be using a round 
style and I wanted miter, my workaround was just to use a separate step plot 
to overlay the outline. But for more general cases (e.g., a bar plot not 
created from a histogram or if I wanted a bevel style), I'm not sure how I 
would do it.

Thanks,
Jeff
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Can't render the \dagger LaTex symbol

2011-09-06 Thread Michael Droettboom
Indeed that is a bug.  That is one of about a dozen missing symbols from 
the mapping that I just found be comparing the legacy Adobe Type1 
name-to-Unicode mapping in matplotlib to the LaTeX-to-Unicode mapping 
that is currently used.  I committed these to master here:


https://github.com/matplotlib/matplotlib/commit/7f55623c84eaa7df7c8c534350ac03a72c32fb83

Mike

On 09/01/2011 10:25 AM, Alejandro Weinstein wrote:
 Hi:

 I am having problems with the \dagger LaTex symbol. The following code

 import matplotlib.pyplot as plt

 plt.plot([1,2,3])
 plt.title(r'$ \dagger $')
 plt.show()

 produce a long Traceback that ends in

 File /usr/lib/pymodules/python2.6/matplotlib/mathtext.py, line 1997,
 in raise_error
  raise ParseFatalException(msg + \n + s)
 ParseFatalException: Expected end of math '$'
 $ \dagger $ (at char 0), (line:1, col:1)

 Other LaTex symbols works OK. For instance, if I use plt.title(r'$
 \diamond $') instead, it works. I checked in mathtext.py, and \dagger
 is in the list of symbols.

 I am running Matplotlib '0.99.1.1'.

 Any idea about this problem?

 Alejandro.

 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Change JPG compression ratio in savefig

2011-09-06 Thread Michael Droettboom
When you call savefig(), you can pass quality, optimize and 
progressive, as defined in the print_jpg docstring:

 def print_jpg(self, filename_or_obj, *args, **kwargs):
 
 Supported kwargs:

 *quality*: The image quality, on a scale from 1 (worst) to
 95 (best). The default is 75. Values above 95 should
 be avoided; 100 completely disables the JPEG
 quantization stage.

 *optimize*: If present, indicates that the encoder should
 make an extra pass over the image in order to select
 optimal encoder settings.

 *progressive*: If present, indicates that this image
 should be stored as a progressive JPEG file.
 

Mike

On 09/05/2011 01:21 PM, Frank Breitling wrote:
 Hi,

 I am using matplotlib.savefig to save my figures as JPEG files.
 Now I need to reduce the JPG compression ratio.
 How can I do this?

 Any hint is appreciated.

 Frank

 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Change JPG compression ratio in savefig

2011-09-06 Thread Michael Droettboom
Sorry for the noise -- I missed that this was already replied to (and 
with much greater detail).

Mike

On 09/06/2011 12:41 PM, Michael Droettboom wrote:
 When you call savefig(), you can pass quality, optimize and
 progressive, as defined in the print_jpg docstring:

   def print_jpg(self, filename_or_obj, *args, **kwargs):
   
   Supported kwargs:

   *quality*: The image quality, on a scale from 1 (worst) to
   95 (best). The default is 75. Values above 95 should
   be avoided; 100 completely disables the JPEG
   quantization stage.

   *optimize*: If present, indicates that the encoder should
   make an extra pass over the image in order to select
   optimal encoder settings.

   *progressive*: If present, indicates that this image
   should be stored as a progressive JPEG file.
   

 Mike

 On 09/05/2011 01:21 PM, Frank Breitling wrote:
 Hi,

 I am using matplotlib.savefig to save my figures as JPEG files.
 Now I need to reduce the JPG compression ratio.
 How can I do this?

 Any hint is appreciated.

 Frank

 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-09-06 Thread Benjamin Root
On Tue, Sep 6, 2011 at 12:01 PM, surfcast23 surfcas...@gmail.com wrote:


 Thanks for everyone responses and help

 Che,

  You are correct on what I have to do. The problem is that I have a data
 set
 with ~1250 so I cant' do the sorting or finding the mean by hand. I guess
 what I need to to is to write a script that will sort the values, bin them,
 and keep track of the number of values in each bin. Then find the mean
 value
 in each bin. Then the scrip has to take the number of values in each bin
 and
 plot that versus the mean of each bin. I apologies for the lack of clarity
 in my earlier posts. It was unclear to me what exactly had to be done until
 this weekend.



I think you really need to read up on the NumPy documentation.  There are
functions that will do this for you.  NumPy can load/save data, sort them,
bin them, find means and standard deviations, etc...  You don't need to
re-invent the wheel.

Plus, you keep on talking about having a script for each part.  While it is
great that you like modularity, Python does support the use of functions,
and I would encourage you to use them.

Cheers,
Ben Root
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] edge joinstyle on rectangles

2011-09-06 Thread Eric Firing
On 09/06/2011 04:48 AM, Michael Droettboom wrote:
 On 08/31/2011 01:20 PM, Eric Firing wrote:
 On 08/31/2011 06:45 AM, Jeffrey Blackburne wrote:
 Hi,

 Are the edges of the rectangles returned by plt.bar() supposed to conform 
 to the 'lines.solid_joinstyle' rcParam? If not, is there another method for 
 specifying that joinstyle?

 I have not been able to change the joinstyle using this method in versions 
 1.0.0 (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a 
 minimal example script if requested.

 The bar rectangles are Patch object outlines, not Line2D objects, and
 solid_joinstyle is not presently supported by patches, as far as I can see.


 I suppose it probably should be supported, though.  Do you agree?

Yes, that would be a nice enhancement.

Eric


 Mike



--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-09-06 Thread C M
 The problem is that I have a data set
 with ~1250 so I cant' do the sorting or finding the mean by hand.

That's not a problem--that's programming!  Even if you had a data set
with five items you should be in the mind set that by hand is an
18th century approach.  This will drive further progress in your
coding abilities.

 I think you really need to read up on the NumPy documentation.  There are
 functions that will do this for you.  NumPy can load/save data, sort them,
 bin them, find means and standard deviations, etc...  You don't need to
 re-invent the wheel.

Ben, that's a good idea.  The only thing here, though, is that
probably the OP would be well served in practicing Python basics and
learning how to think up procedures, write them down, and then put
them into Python code.  Re-inventing the wheel, *at least to learn*
could really be useful here.  I've also found that sometimes it is
easier to just reinvent a wheel than learn a library's API, at least
to get started.  Considering his task requires mostly just creating
lists based on conditionals and then doing some 5th grade math, he
might want to try it himself before he uses NumPy.  But of course he
can get there either way.

Che

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] it is possible to use basemap to create regular spaced lat/lon grids?

2011-09-06 Thread Matt Funk
Hi,
i want to interpolate irregular spaced satellite data onto a regular
spaced grid. The regular spaced grid should have cell sizes of 1km^2. Is
it possible to use basemap to create such a grid. It looked like it
includes some facilities like that, but i am not sure if they are meant
to be used by end user or more like internal fcns (the makegrid fcn for
example).

Any advice would be appreciated.

thanks
matt

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] it is possible to use basemap to create regular spaced lat/lon grids?

2011-09-06 Thread Aman Thakral
Hi Matt,

Something like this?:

def create_map(ax, llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat):
m =
Basemap(llcrnrlon=llcrnrlon,llcrnrlat=llcrnrlat,urcrnrlon=urcrnrlon,urcrnrlat=urcrnrlat,resolution='i',projection='cyl',lon_0=(urcrnrlon+llcrnrlon)/2,lat_0=(urcrnrlat+llcrnrlat)/2)
m.drawcoastlines()
m.drawmapboundary()
m.drawstates(linewidth=3)
m.fillcontinents(color='lightgrey',lake_color='white')
m.drawcountries(linewidth=3)
return m


def plotMapData(ax,data):

lats = []
lons = []
val = []

for k,v in data.iteritems():
lats.append(float(k[0]))
lons.append(float(k[1]))
val.append(float(v))

value = np.array(val)
lat = np.array(lats)
lon = np.array(lons)

llcrnlon = lon.min()-0.5
llcrnlat = lat.min()-0.5
urcrnlon = lon.max()+0.5
urcrnlat = lat.max()+0.5

xi = np.linspace(llcrnlon,urcrnlon,1000)
yi = np.linspace(llcrnlat,urcrnlat,1000)
zi = griddata(lon,lat,value,xi,yi)

cmap = cm.jet
m = create_map(ax,llcrnlon,llcrnlat,urcrnlon,urcrnlat)
cs = ax.contour(xi,yi,zi,15,linewidth=0.5,cmap=cmap,alpha=0.5)
ax.contourf(xi,yi,zi,15,cmap=cmap,zorder=1000,alpha=0.5)

colorscale = cm.ScalarMappable()
colorscale.set_array(value)
colorscale.set_cmap(cmap)

colors = colorscale.to_rgba(value)
ax.scatter(lon,lat,c=colors,zorder=1000,cmap=cmap,s=10)
colorbar(colorscale, shrink=0.50, ax=ax,extend='both')


On Tue, Sep 6, 2011 at 1:28 PM, Matt Funk matze...@gmail.com wrote:

 Hi,
 i want to interpolate irregular spaced satellite data onto a regular
 spaced grid. The regular spaced grid should have cell sizes of 1km^2. Is
 it possible to use basemap to create such a grid. It looked like it
 includes some facilities like that, but i am not sure if they are meant
 to be used by end user or more like internal fcns (the makegrid fcn for
 example).

 Any advice would be appreciated.

 thanks
 matt


 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-09-06 Thread surfcast23



Benjamin Root-2 wrote:
 
 On Tue, Sep 6, 2011 at 12:01 PM, surfcast23 surfcas...@gmail.com wrote:
 

 Thanks for everyone responses and help

 Che,

  You are correct on what I have to do. The problem is that I have a data
 set
 with ~1250 so I cant' do the sorting or finding the mean by hand. I guess
 what I need to to is to write a script that will sort the values, bin
 them,
 and keep track of the number of values in each bin. Then find the mean
 value
 in each bin. Then the scrip has to take the number of values in each bin
 and
 plot that versus the mean of each bin. I apologies for the lack of
 clarity
 in my earlier posts. It was unclear to me what exactly had to be done
 until
 this weekend.



 I think you really need to read up on the NumPy documentation.  There are
 functions that will do this for you.  NumPy can load/save data, sort them,
 bin them, find means and standard deviations, etc...  You don't need to
 re-invent the wheel.
 
 Plus, you keep on talking about having a script for each part.  While it
 is
 great that you like modularity, Python does support the use of functions,
 and I would encourage you to use them.
 
 Cheers,
 Ben Root
 
 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better 
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 


Hi Ben,

  I will read up the numpy docs when I get some time. I am only writing one
script that will do everything sorry if I gave the impression of having
multiple scripts. 

-- 
View this message in context: 
http://old.nabble.com/How-do-you-Plot-data-generated-by-a-python-script--tp32328822p32410694.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] it is possible to use basemap to create regular spaced lat/lon grids?

2011-09-06 Thread Matt Funk
Hi Aman,
thanks for your code. I am testing it right now, but i think this might
what i need.
Not sure if you know this: what is the difference between:
1) scipy.interpolate.griddata
2) matplotlib.mlab.griddata

For 2) you have specify the interpolation method and i think the calling
convention is different. Is one a wrapper for the other?

thanks
matt


On 9/6/2011 12:36 PM, Aman Thakral wrote:
 Hi Matt,

 Something like this?:

 def create_map(ax, llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat):
 m =
 Basemap(llcrnrlon=llcrnrlon,llcrnrlat=llcrnrlat,urcrnrlon=urcrnrlon,urcrnrlat=urcrnrlat,resolution='i',projection='cyl',lon_0=(urcrnrlon+llcrnrlon)/2,lat_0=(urcrnrlat+llcrnrlat)/2)
 m.drawcoastlines()
 m.drawmapboundary()
 m.drawstates(linewidth=3)
 m.fillcontinents(color='lightgrey',lake_color='white')
 m.drawcountries(linewidth=3)
 return m


 def plotMapData(ax,data):

 lats = []
 lons = []
 val = []
   
 for k,v in data.iteritems():
 lats.append(float(k[0]))
 lons.append(float(k[1]))
 val.append(float(v))
   
 value = np.array(val)
 lat = np.array(lats)
 lon = np.array(lons)

 llcrnlon = lon.min()-0.5
 llcrnlat = lat.min()-0.5
 urcrnlon = lon.max()+0.5
 urcrnlat = lat.max()+0.5

 xi = np.linspace(llcrnlon,urcrnlon,1000)
 yi = np.linspace(llcrnlat,urcrnlat,1000)
 zi = griddata(lon,lat,value,xi,yi)

 cmap = cm.jet
 m = create_map(ax,llcrnlon,llcrnlat,urcrnlon,urcrnlat)
 cs = ax.contour(xi,yi,zi,15,linewidth=0.5,cmap=cmap,alpha=0.5)   
 ax.contourf(xi,yi,zi,15,cmap=cmap,zorder=1000,alpha=0.5)

 colorscale = cm.ScalarMappable()
 colorscale.set_array(value)
 colorscale.set_cmap(cmap)

 colors = colorscale.to_rgba(value)
 ax.scatter(lon,lat,c=colors,zorder=1000,cmap=cmap,s=10)
 colorbar(colorscale, shrink=0.50, ax=ax,extend='both')


 On Tue, Sep 6, 2011 at 1:28 PM, Matt Funk matze...@gmail.com
 mailto:matze...@gmail.com wrote:

 Hi,
 i want to interpolate irregular spaced satellite data onto a regular
 spaced grid. The regular spaced grid should have cell sizes of
 1km^2. Is
 it possible to use basemap to create such a grid. It looked like it
 includes some facilities like that, but i am not sure if they are
 meant
 to be used by end user or more like internal fcns (the makegrid
 fcn for
 example).

 Any advice would be appreciated.

 thanks
 matt

 
 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Matt Funk
Research Associate
Plant and Environmental Scienc. Dept.
New Mexico State University

--
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] it is possible to use basemap to create regular spaced lat/lon grids?

2011-09-06 Thread Benjamin Root
On Tue, Sep 6, 2011 at 2:48 PM, Matt Funk matze...@gmail.com wrote:

  Hi Aman,
 thanks for your code. I am testing it right now, but i think this might
 what i need.
 Not sure if you know this: what is the difference between:
 1) scipy.interpolate.griddata
 2) matplotlib.mlab.griddata

 For 2) you have specify the interpolation method and i think the calling
 convention is different. Is one a wrapper for the other?

 thanks
 matt


No, they are not wrappers.

I don't know the full details, but the idea was that we didn't want to have
SciPy as a dependency, so mlab was used to replicate many of the functions
found in SciPy.  I don't know why the calling conventions are different,
though.

Ben Root
--
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Moving plot windows?

2011-09-06 Thread Ethan Gutmann

Hi, 
I'm trying to move plot windows programmatically, or at least control where
a new window opens.  At the moment, every new window opens 20px further
down/right from the previous new window, but can I tell it to open e.g. 0px
down and 100px right?  Or can I move it after it opens? I've dug around a
bit and gotten lost in fig.canvas.get_tk_widget(), am I looking in the wrong
place?  

At the moment I'm using the TkAgg backend with matplotlib 1.0.1 (python 2.6)
on Mac OS X.  

thanks,
Ethan

-- 
View this message in context: 
http://old.nabble.com/Moving-plot-windows--tp32411243p32411243.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] it is possible to use basemap to create regular spaced lat/lon grids?

2011-09-06 Thread Paul Hobson
On Tue, Sep 6, 2011 at 12:58 PM, Benjamin Root ben.r...@ou.edu wrote:

 I don't know the full details, but the idea was that we didn't want to have
 SciPy as a dependency, so mlab was used to replicate many of the functions
 found in SciPy.  I don't know why the calling conventions are different,
 though.

 Ben Root

Apologies for drifting off-topic. I understand the desire to not
require scipy, but how likely is that to change? I've written a BCa
bootstrapper[1] for boxplots, but it needs scipy, so I can't
contribute it back to the community.

[1] - http://staff.ustc.edu.cn/~zwp/teach/Stat-Comp/Efron_Bootstrap_CIs.pdf


Cheers,
-paul

--
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] it is possible to use basemap to create regular spaced lat/lon grids?

2011-09-06 Thread Eric Firing
On 09/06/2011 12:55 PM, Paul Hobson wrote:
 On Tue, Sep 6, 2011 at 12:58 PM, Benjamin Rootben.r...@ou.edu  wrote:

 I don't know the full details, but the idea was that we didn't want to have
 SciPy as a dependency, so mlab was used to replicate many of the functions
 found in SciPy.  I don't know why the calling conventions are different,
 though.

 Ben Root

 Apologies for drifting off-topic. I understand the desire to not
 require scipy, but how likely is that to change? I've written a BCa
 bootstrapper[1] for boxplots, but it needs scipy, so I can't
 contribute it back to the community.

If you are asking whether matplotlib will ever depend on scipy, the 
answer is no, not in any future I can foresee.  Its purpose is 
plotting, not calculating.  There are some simple deviations from this 
mission--spectral plots and histograms, for example--but they depend 
only on numpy. Maybe your BCa code can be contributed to scipy?

Eric


 [1] - http://staff.ustc.edu.cn/~zwp/teach/Stat-Comp/Efron_Bootstrap_CIs.pdf


 Cheers,
 -paul

 --
 Malware Security Report: Protecting Your Business, Customers, and the
 Bottom Line. Protect your business and customers by understanding the
 threat from malware and how it can impact your online business.
 http://www.accelacomm.com/jaw/sfnl/114/51427462/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] edge joinstyle on rectangles

2011-09-06 Thread Jae-Joon Lee
On Wed, Sep 7, 2011 at 12:47 AM, Jeffrey Blackburne
jblackbu...@alum.mit.edu wrote:
 It would be nice to have. Since the patch edge seemed to be using a round 
 style and I wanted miter, my workaround was just to use a separate step 
 plot to overlay the outline. But for more general cases (e.g., a bar plot not 
 created from a histogram or if I wanted a bevel style), I'm not sure how I 
 would do it.

 Thanks,
 Jeff


I also agree that this needs to be supported.
Meanwhile, a workaround is to use the patheffects module.

For example,

from matplotlib.patheffects import Stroke

b = bar([0, 1, 2], [1, 0.5, 2], linewidth=10, fc=none)
for p in b:
p.set_path_effects([Stroke(joinstyle=miter)])

-JJ

--
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to make an arrow all one color?

2011-09-06 Thread Brad Malone
Hi, I am trying to draw a brown arrow to a particular part of my figure but
am having some difficulty. The code I'm currently using is something like:

annotate('notice
 this',xy=(119.628,-7.9158),xytext=(0.8,0.5),textcoords='axes fraction'

 ,arrowprops=dict(facecolor=((0.549,0.176,0.0156)),shrink=0.02,width=1,headwidth=

 6,frac=0.05),fontsize=12,horizontalalignment='right',verticalalignment='top',color=((0.549,0.176,0.0156)))



However, when I do this it only makes the HEAD of the arrow brown, while the
body of the arrow is still black. What am I missing?

Lastly (and unrelated to the topic) when I insert such a figure in Latex it
looks fine in my later-generated PDF. But if I increase the fontsize part of
the figure gets cut off. What's the best way to fix this? In the past I
would usually just toy around and mess with the BoundingBox in the *eps
file, but I wondered if there was a more legitimate way.

Thanks for the help! I appreciate it.

Brad
--
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to make an arrow all one color?

2011-09-06 Thread Brad Malone
Jae-Joon,

Thanks! That worked perfectly.

Brad

On Tue, Sep 6, 2011 at 6:46 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote:

 In matplotlib, patches have two colors; facecolor and edgecolor.
 So, try something like this

 arrowprops=dict(facecolor=((0.549,0.176,0.0156)),
  edgecolor=(0.549,0.176,0.0156),
  shrink=0.02,width=1,headwidth=6,frac=0.05),

 Regards,

 -JJ


 On Wed, Sep 7, 2011 at 10:35 AM, Brad Malone brad.mal...@gmail.com
 wrote:
  Hi, I am trying to draw a brown arrow to a particular part of my figure
 but
  am having some difficulty. The code I'm currently using is something
 like:
 
  annotate('notice
  this',xy=(119.628,-7.9158),xytext=(0.8,0.5),textcoords='axes fraction'
 
 
 ,arrowprops=dict(facecolor=((0.549,0.176,0.0156)),shrink=0.02,width=1,headwidth=
 
 
 6,frac=0.05),fontsize=12,horizontalalignment='right',verticalalignment='top',color=((0.549,0.176,0.0156)))
 
  However, when I do this it only makes the HEAD of the arrow brown, while
 the
  body of the arrow is still black. What am I missing?
  Lastly (and unrelated to the topic) when I insert such a figure in Latex
 it
  looks fine in my later-generated PDF. But if I increase the fontsize part
 of
  the figure gets cut off. What's the best way to fix this? In the past I
  would usually just toy around and mess with the BoundingBox in the *eps
  file, but I wondered if there was a more legitimate way.
  Thanks for the help! I appreciate it.
  Brad
 
 --
  Using storage to extend the benefits of virtualization and iSCSI
  Virtualization increases hardware utilization and delivers a new level of
  agility. Learn what those decisions are and how to modernize your storage
  and backup environments for virtualization.
  http://www.accelacomm.com/jaw/sfnl/114/51434361/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 

--
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users