Re: [Matplotlib-users] code searching
Thanks John, it's what I need. Le vendredi 06 février 2009 à 13:10 -0600, John Hunter a écrit : On Fri, Feb 6, 2009 at 10:56 AM, Ryan May rma...@gmail.com wrote: Lionel Roubeyrie wrote: You're right, it's the chaco's zooming plot, I confused. Is there a way to have this render with matplotlib? The event_handling/zoom_window.py example is kind of similar and might give some clues of where to go. But no, I don't know of a straight-forward version of chaco's example using matplotlib. Patches are accepted. :) The following example is pretty close to what you want I think -- select a span in the upper axes to see the zoom in the lower: http://matplotlib.sourceforge.net/examples/widgets/span_selector.html JDH -- Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie chargé d'études LIMAIR - La Surveillance de l'Air en Limousin http://www.limair.asso.fr -- Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] code searching
You're right, it's the chaco's zooming plot, I confused. Is there a way to have this render with matplotlib? Le jeudi 05 février 2009 à 10:41 -0600, Ryan May a écrit : Lionel Roubeyrie wrote: Hi all, On the matplotlib website I can't find an old example code showing a figure with two vertical plots, where the second represents a zoom of some selected datas in a rectangle of the first axis, and between the two axis there was a trapezoid. If someone has this code, I'll be happy to get it :) Thanks I don't remember a demo like that in matplotlib, but I do remember such a demo for Chaco2. Ryan -- Lionel Roubeyrie chargé d'études LIMAIR - La Surveillance de l'Air en Limousin http://www.limair.asso.fr -- Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] code searching
Hi all, On the matplotlib website I can't find an old example code showing a figure with two vertical plots, where the second represents a zoom of some selected datas in a rectangle of the first axis, and between the two axis there was a trapezoid. If someone has this code, I'll be happy to get it :) Thanks -- Lionel Roubeyrie chargé d'études LIMAIR - La Surveillance de l'Air en Limousin http://www.limair.asso.fr -- Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] contour coordinates
, USA 80303-3328 Web: http://tinyurl.com/5telg -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I'm not sure if this is entirely what you (Eli) are looking for, but I have code that will contour model data on a map and then extract the lat,lon pairs of all the vertices. If this is what you are looking for, I'm happy to share what I've done. -Patrick -- Patrick Marsh Graduate Research Assistant School of Meteorology University of Oklahoma http://www.patricktmarsh.com -- Patrick Marsh Graduate Research Assistant School of Meteorology University of Oklahoma http://www.patricktmarsh.com -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie chargé d'études LIMAIR - La Surveillance de l'Air en Limousin http://www.limair.asso.fr -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Pylab breaks locales with GTK
Hi all, Trying to write to text files some plotted datas, we have a strange behavour on masked arrays after importing pylab, with the dot decimal separator replaced by a comma (but not all) : ## Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for more information. import numpy as np a=np.ma.array([1., 1.01, 2.11, 3.61]) for i in a:str(i) ... '1.0' '1.01' '2.11' '3.61' import matplotlib for i in a:str(i) ... '1.0' '1.01' '2.11' '3.61' import pylab for i in a:str(i) ... '1.0' '1,01' '2,11' '3,61' np.__version__, matplotlib.__version__ ('1.2.1', '0.98.3') # Any help welcomes! -- Lionel Roubeyrie chargé d'études LIMAIR - La Surveillance de l'Air en Limousin http://www.limair.asso.fr -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Pylab breaks locales with GTK
Thanks for your responses, Looking comments in the tickets, putting import locale locale.setlocale(locale.LC_NUMERIC, 'C') after the pylab import resolves the problem (but not the bug...). Have a happy new year Le lundi 05 janvier 2009 à 15:37 +0100, Lionel Roubeyrie a écrit : Hi all, Trying to write to text files some plotted datas, we have a strange behavour on masked arrays after importing pylab, with the dot decimal separator replaced by a comma (but not all) : ## Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for more information. import numpy as np a=np.ma.array([1., 1.01, 2.11, 3.61]) for i in a:str(i) ... '1.0' '1.01' '2.11' '3.61' import matplotlib for i in a:str(i) ... '1.0' '1.01' '2.11' '3.61' import pylab for i in a:str(i) ... '1.0' '1,01' '2,11' '3,61' np.__version__, matplotlib.__version__ ('1.2.1', '0.98.3') # Any help welcomes! -- Lionel Roubeyrie chargé d'études LIMAIR - La Surveillance de l'Air en Limousin http://www.limair.asso.fr -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] windrose OO
Hi all, with few free hours, I have modified the windrose file to be O.O. compliant with the 0.98 matplotlib branch and normally bug free. The next posts will be on sourceforge : https://sourceforge.net/project/showfiles.php?group_id=239240package_id=290902 and to see it in detail, here is the entry on blogspot: http://youarealegend.blogspot.com/2008/09/windrose.html All suggestion welcome (even to correct my bad english ;-) ) Thanks to the best python plotting library and the matplotlib team! -- Lionel Roubeyrie - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] polar interpolation
Hi all, the new polar projection gives me a strange behavour by interpolating each simple line between two consecutives points. Where I just want points at specified coordinates and lines connecting them, between each pairs appears a interpolated line in polar projection with multiple points. Looking in the documentation doesn't give an alternative. Is there a way to have just simples lines? thanks ## from pylab import * theta = arange(0, 360, 36) r = [5,1] * (len(theta)/2) polar(radians(theta), r, 'o-') show() ## -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] windrose OO
Hi, sorry for the latency, holidays just finished :-( Find with this message a modified version of windrose_oo, but I'm not very familiar with the new projections facilities, and then the code is buggy : ## Traceback (most recent call last): File windrose_oo.py, line 464, in module ax = WindroseAxes(fig, rect, axisbg='w') File windrose_oo.py, line 33, in __init__ PolarAxes.__init__(self, *args, **kwargs) File /usr/lib/python2.5/site-packages/matplotlib/projections/polar.py, line 171, in __init__ Axes.__init__(self, *args, **kwargs) File /usr/lib/python2.5/site-packages/matplotlib/axes.py, line 529, in __init__ self.cla() File windrose_oo.py, line 47, in cla PolarAxes.cla(self) File /usr/lib/python2.5/site-packages/matplotlib/projections/polar.py, line 177, in cla Axes.cla(self) File /usr/lib/python2.5/site-packages/matplotlib/axes.py, line 771, in cla self.xaxis.cla() AttributeError: 'NoneType' object has no attribute 'cla' # I don't understand why this problem occurs, if someone can the mistake, I'll appreciate :-) Thanks Christopher Barker a écrit : Lionel Roubeyrie wrote: find with this message a modified version of windrose to be OO compliant. Lionel, I've had this message of yours (from March), and finally had a chance to use it. Unfortunately, it seems to use the old Transforms mechanism, so won't work with the latest MPL. have you ported it over yet? Can anyone else help out with a port? Thanks, -Chris -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr #!/usr/bin/env python # -*- coding: utf-8 -*- __version__ = '0.2' __author__ = 'Lionel Roubeyrie' __mail__ = '[EMAIL PROTECTED]' __license__ = 'matplotlib license' import matplotlib import matplotlib.cm as cm import numpy as N from matplotlib.patches import Rectangle, Polygon from matplotlib.ticker import ScalarFormatter, AutoLocator from matplotlib.text import Text, FontProperties from matplotlib.projections.polar import PolarAxes from matplotlib.cbook import popd, popall from numpy.lib.twodim_base import histogram2d class WindroseAxes(PolarAxes): Makes a windrose axes RESOLUTION = 100 def __init__(self, *args, **kwargs): See Axes base class for args and kwargs documentation PolarAxes.__init__(self, *args, **kwargs) self.set_aspect('equal', adjustable='box', anchor='C') self.radii_angle = 67.5 self.cla() def _init_axis(self): self.xaxis = None self.yaxis = None def cla(self): Clear the current axes PolarAxes.cla(self) self.theta_angles = N.arange(0, 360, 45) self.theta_labels = ['E', 'N-E', 'N', 'N-W', 'W', 'S-W', 'S', 'S-E'] self.set_thetagrids(angles=self.theta_angles, labels=self.theta_labels) self._info = {'dir' : list(), 'bins' : list(), 'table' : list()} self.patches_list = list() def _colors(self, cmap, n): ''' Returns a list of n colors based on the colormap cmap ''' return [cmap(i) for i in N.linspace(0.0, 1.0, n)] def set_radii_angle(self, **kwargs): Set the radii labels angle null = popd(kwargs, 'labels', None) angle = popd(kwargs, 'angle', None) if angle is None: angle = self.radii_angle self.radii_angle = angle radii = N.linspace(0.1, self.get_rmax(), 6) radii_labels = [ %.1f %r for r in radii ] radii_labels[0] = #Removing label 0 null = self.set_rgrids(radii=radii, labels=radii_labels, angle=self.radii_angle, **kwargs) def _update(self): self.regrid(self.get_rmax()) self.set_radii_angle(angle=self.radii_angle) def legend(self, loc='lower left', **kwargs): Sets the legend location and her properties. The location codes are 'best' : 0, 'upper right' : 1, 'upper left' : 2, 'lower left' : 3, 'lower right' : 4, 'right': 5, 'center left' : 6, 'center right' : 7, 'lower center' : 8, 'upper center' : 9, 'center' : 10, If none of these are suitable, loc can be a 2-tuple giving x,y in axes coords, ie, loc = (0, 1) is left top loc = (0.5, 0.5) is center, center and so on. The following kwargs are supported: isaxes=True # whether this is an axes legend prop = FontProperties(size='smaller') # the font property pad = 0.2 # the fractional whitespace inside the legend border shadow# if True, draw a shadow behind legend
Re: [Matplotlib-users] Basemap to KML polygon
Hi Tim, like I said, I want to convert a filled contours map generated with Basemap (example here : http://imagebin.ca/view/3nYnN3.html) to a polygon shapefile (vector). The filled contours are from a regular points grid which can already be saved into a point shapefile (via ogr python bindings) and I use QGIS to render it. Now I search to get the filled result into a shp file to pass it through ogr2ogr -f KML and render it with GoogleEarth. I know I can do all this process with the QGIS-GRASS interface, but I must limit softwares dependencies 'cause it'll be placed on a web server, and I think Python it's the best choice for doing that :-) After multiple tests, I can retrieve the polygons points coordinates via matplotlib.Patch and save them in a shp file. Now I have troubles with real coordinates and meta-datas, but nothing impossible :-) Tim Michelsen a écrit : Looks like I've done a mistake with my last post, sorry Eli... I know how to save datas to a shapefile with the OGR library but only for points datas. I'll appreciate if somebody can point me how to save a filled contour map basemap into a polygon shapefile, can't find any example with google. What do you really want to save here? A basemap with a contour surface overlayed can be viewed as a assembly of various layers. So this is like the result of the gis operations when you launch the map composer to finish your map. If you want to create a raster file from the contour part plotted over a basemap I think the python bindings of gdal will get you started. http://pypi.python.org/pypi/GDAL/ I succeded into writing a tiff file from a gdal array. I don't know how to write a vector file from python with ogr or shapely. But these questions are better to be asked on the gdal list.: So about interpolating to a contour look at shapely. Writing should be accomplished with ogr. That said, I only have testing experience with writing geodata with python. The overkill may be to invoke the respective GRASS command by a script. I would appreciate if you would tell us what you use by the end. Kind regards, Timmie When it comes to python and GIS the first stop seems to be: * http://gispython.org/ * http://lists.gispython.org/mailman/listinfo/community Some more links: * http://de.giswiki.net/wiki/Kategorie:Python * http://de.giswiki.net/wiki/WorldMill * http://zcologia.com/news/750/keytree/ * http://sgillies.net/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Basemap to KML polygon
thanks for this link Scott, I went into the refernce API directly without looking at this tutorial. Effectively, it works :-) Scott Sinclair a écrit : Lionel Roubeyrie [EMAIL PROTECTED] 07/23/08 9:37 AM I want to convert a filled contours map generated with Basemap (example here : http://imagebin.ca/view/3nYnN3.html) to a polygon shapefile (vector). After multiple tests, I can retrieve the polygons points coordinates via matplotlib.Patch and save them in a shp file. Now I have troubles with real coordinates and meta-datas, but nothing impossible :-) Hi, If you're after a 'quick and dirty' solution. As I understand it a KML file can be used to specify the Latitude and Longitude extent of a raster image (See 'Ground Overlays' at http://code.google.com/apis/kml/documentation/kml_tut.html). If you can accept some distortion of the text on your image (should be small with a small region) and can work out the size of each pixel in degrees of lat and lon, then all you need to do is write a simple text file to specify where Google Earth should display your Basemap contour map. What you're doing does sound more elegant, but more complex. Regards, Scott Please find our Email Disclaimer here: http://www.ukzn.ac.za/disclaimer/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Basemap to KML polygon
Looks like I've done a mistake with my last post, sorry Eli... I know how to save datas to a shapefile with the OGR library but only for points datas. I'll appreciate if somebody can point me how to save a filled contour map basemap into a polygon shapefile, can't find any example with google. Thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Basemap to KML polygon
Hi all, just to know if there's a proper way to convert a basemap generated with contourf to a KML (or polygon shapefile) ? Thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] how to save animation
Hi, install mencoder :-) sa6113 a écrit : Unfortuantly this link dosen't help me. Would be please help me more clear. sa6113 wrote: Thanks for your help but there is a problem while I using this code, it raises an error : mencoder is not recognized as an internal or external command, operable program or batch file. Darren Dale-3 wrote: On Monday 30 June 2008 04:18:14 sa6113 wrote: I want to save an animation in avi format by python code, would you please help me to start in this way? At the FAQ page, http://matplotlib.sourceforge.net/faq.html , there is a section titled How do I make a movie with matplotlib? - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Ubuntu Hardy and matplotlib
Don't sure last matplotlib version (and numpy) is in Hardy repositories. Here we do : 1- sudo apt-get --purge remove python-numpy* python-matplotlib* python-scipy* 2- manually remove all related folders under site-packages (with eggs!) 3- download and install manually numpy, scipy and matplotlib (and basemap) Le mardi 17 juin 2008, Marjolaine Rouault a écrit : Hi, I have tried reinstalling python-matplotlib and python-matplotlib-data as well as reinstalling python-gtk2 and none of this proposed solutions work. Still stuck unfortunately. I am thinking maybe my ubuntu is not right. Could you guys let me know which repositories you use and I could try and upgrade my ubuntu to one of new repositories lists? Thank -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] prctile not interpolating
You can use the scipy version: |~|[10]from scipy.stats import stats |~|[11]stats.scoreatpercentile(x,50) Out [11]:7.5 Le vendredi 28 mars 2008, David Simpson a écrit : I would like to find percentiles, with interpolation where needed, but the matplotlib prctile seems to be different to matlab in this respect: In [1]: x = array([ 3.0, 5.0, 7.0, 8.0, 9.0, 11.0 ]) In [2]: median(x) Out[2]: 7.5 In [3]: prctile(x,50) Out[3]: 8.0 is there a function available which does include interpolation, or should I just write my own? (I'd also like 10th and 90th percentiles for example). Thanks, Dave - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac e ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] windrose OO
Hi all, find with this message a modified version of windrose to be OO compliant. It uses inheritance from PolarAxes to create a WindroseAxes, with 4 methods (contour, contourf, bar and box). BTW it's now possible to control it like any other axes, with the limitation of subploting (subplot is to closer to simple axe and polaraxe). There's also a extra argument 'blowto' which reverse the plot (used in pollutantrose), and scipy is not required (just numpy). Hope someone find it usefull Cordialy -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr windrose_oo.py Description: application/python - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] raster in basemap
Jeff, yes it works, the unique constraint is to put the image when we create the basemap instance. Le jeudi 28 février 2008, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi Jeff, yes I see this method, but set_xlim and set_ylim use axes coordinates, and I would like to use geographic coordinates. It would be great if we could put an image in a map directly by specifying its geographic coordinates Lionel: There's no way to do that - but it's pretty easy to convert to geographic to map (axes) coordinates using the Basemap instance __call__ method. So, if m is the Basemap instance, you can do something like x1,y1 = m(lon1,lon1) x2,y2 = m(lon2,lat2) ax.set_ylim(y1,y2) ax.set_xlim(x1,x2) -Jeff Le mardi 26 février 2008, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi all, I'm sure it's a trivial question, but can't find any valid answer in the basemap examples directory or with google : I have a georeferenced TIFF file in 'lcc' projection, representing a little portion of France, and I need to put it on a map, resets map limits to a closed portion of the map, and put contours on it. I see how to initialise Basemap with the limits of the raster, but not how to make a zoom in the map by specifing coordinates. Thanks for your help Lionel: You can use the set_xlim and set_ylim axes methods to manually 'zoom' the plot. It has to be done after all the other plotting though, since all the Basemap methods (contour, imshow etc) will reset the axes limits to show the entire map region. -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] raster in basemap
Hi Jeff, yes I see this method, but set_xlim and set_ylim use axes coordinates, and I would like to use geographic coordinates. It would be great if we could put an image in a map directly by specifying its geographic coordinates Le mardi 26 février 2008, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi all, I'm sure it's a trivial question, but can't find any valid answer in the basemap examples directory or with google : I have a georeferenced TIFF file in 'lcc' projection, representing a little portion of France, and I need to put it on a map, resets map limits to a closed portion of the map, and put contours on it. I see how to initialise Basemap with the limits of the raster, but not how to make a zoom in the map by specifing coordinates. Thanks for your help Lionel: You can use the set_xlim and set_ylim axes methods to manually 'zoom' the plot. It has to be done after all the other plotting though, since all the Basemap methods (contour, imshow etc) will reset the axes limits to show the entire map region. -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] raster in basemap
Hi all, I'm sure it's a trivial question, but can't find any valid answer in the basemap examples directory or with google : I have a georeferenced TIFF file in 'lcc' projection, representing a little portion of France, and I need to put it on a map, resets map limits to a closed portion of the map, and put contours on it. I see how to initialise Basemap with the limits of the raster, but not how to make a zoom in the map by specifing coordinates. Thanks for your help -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] easy_install basemap
Hi all, don't sure it's the best way, but I have tried to install basemap via easy_install. the installation works fine (after a export GEOS_DIR), but it impossible to import it :-( Is there a special manipulation to get it working? Thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] twinx doesn't keep xticks parameters
Hi, all is in the subject: # ax=axes() setp(ax.get_xticklabels(), rotation=30, fontsize=14) twinx() It's not really a problem because we can manually modify the xticks, but it would be great if it was done automatically. Cheers -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] using strpdate2num in load
Hi Emmanuel, look at dateutil.parser.parse, there is exactly what you search. Le mardi 18 décembre 2007, Emmanuel a écrit : Ok, thank you! I'm missing an option to (easily) use date that start with the day day/month/year (it is the case in Brazil and France for example) I'm using something like tha date_Ymd=%s/%s/%s % (datedayfirst.split('/')[2],datedayfirst.split ('/')[1],datedayfirst.split ('/')[0]) I was lookigng for sometinh like that : datestr2num(a,dayfirst=True) or datestr2num(a,fmt=%d/%m/%Y) On Dec 11, 2007 11:16 AM, John Hunter [EMAIL PROTECTED] wrote: On Dec 11, 2007 6:00 AM, Emmanuel [EMAIL PROTECTED] wrote: Hi, I've a little problem with date conversion. I have a csv file which looks like : Data,Valor 15/01/2007, 6,700012000 12/01/2007, 6,659903000 11/01/2007, 6,701586000 I try to get date using function strpdate2num in load doing this : Try stripping the double quote characters from you file. JDH - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] ps.usedistiller doesn't know ghostscript version
Hi all, there's a little problem with ghostscript on ubuntu gutsy, mpl complaints about a bad version : ipython -pylab /usr/lib/python2.5/site-packages/matplotlib/__init__.py:641: UserWarning: matplotlibrc ps.usedistiller option can not be used unless ghostscript-7.07 or later is installed on your system but gs -v returns: GPL Ghostscript SVN PRE-RELEASE 8.61 (2007-08-02) Copyright (C) 2007 Artifex Software, Inc. All rights reserved. Here is the modified __init__.py to deal with it : def checkdep_ghostscript(): try: if sys.platform == 'win32': command = 'gswin32c -v' else: command = 'gs --version' stdin, stdout = os.popen4(command) line = stdout.readlines()[0] v = line.strip() vtest = '.'.join(v.split('.')[:2]) # deal with version numbers like '7.07.1' float(vtest) return vtest matplotlib.__version__ Out [10]:'0.90.1' -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] images layers
Hi all, I think it's a trivial question, but don't find a solution: Drawing an image with imshow (in fact basemap.imshow), I need to put others images on it, but smallers, at specified locations. Is there a way to do so, I have tried with extent parameter, but doesn't do what I expect? Thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] images layers
Hi Jeff, I've saw that, but I have the smalls images coordinates in geographic system, then I need to recompute their position everytime the user will change the figure's aspect, ... Not very usefull. Is there a way to extend the missing areas around each small image by a transparent value, and put this new image layer on the background image? My last chance is to perform the operation directly with PIL, but BTW, I'll lose Basemap projections facilities. Le jeudi 04 octobre 2007, Jeff Whitaker a écrit : Lionel: I think you'll need to add other axes to the figure, and then draw the image with axes.imshow. See http://matplotlib.sourceforge.net/screenshots/axes_demo.py for an example of how to use inset axes. -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Geo raster
Hi all, Can't find any examples on google, then I come here to see if it's possible to display a georeferenced map (geotiff on my side) into Basemap. The PCL module seems great, but there's not useful information on the Trac website. Thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Geo raster
Hi Jeff, thanks for the reply. Effectively, I saw the warpimage example, and based on that I just want to know if somebody has already used the PCL module to retrieve geographical informations (or another module). Le jeudi 20 septembre 2007, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi all, Can't find any examples on google, then I come here to see if it's possible to display a georeferenced map (geotiff on my side) into Basemap. The PCL module seems great, but there's not useful information on the Trac website. Thanks Lionel: There's an example in Basemap (warpimage.py) of displaying a plain old png file on different map projections. If you can figure out how to read a geotiff (I've never tried it, but GDAL should be able to do it), you should be able to use the projection information in the file to figure out the lat/lon values of each pixel. Then you could follow the warpimage.py example to transform it to some other map projection. Or, if you want to display it in it's native projection, just use the projection information in the geotiff to define a Basemap instance, extract the rgba values and plot them with Basemap.imshow. -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] table data type and plot functions?
Hi Ping, don't know if it could help you : from pylab import * d = Table(xyt.dat) x,y,t = load(xyt.dat, unpack=true) d.plot(x, t)# make a plot of x vs. t, N points are drawn plot(t, x) d.plot(x) # make a histogram plot of x, N entries in the histogram bar(range(len(x)), x) d.plot(x, y 3) # make a histogram plot of x where y is less than 3. ind = find(y 3) xi = x[ind] bar(range(len(xi)), xi) Cheers - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] ticklabels positions not updated
Hi all, I'm going crazy with ticklabels positions, I just want to update yticklabels but nothing changes : tlist=gca().get_yticklabels() tlist[1].get_position() Out [571]:(0.0, 1.0) tlist[1].set_position((0.0, 2.0)) draw() tlist[1].get_position() Out [574]:(0.0, 1.0) Do I miss something? Thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] savefig pdf doesn't work anymore
Hi all, I've got a problem with saving plots in pdf format like you can see in the following output. It seems encodings.cp1252 doesn't have a decoding_map method (but a decoding_table one). Is it a bug or a problem in my encodings file? thanks |Diagrammes|[68]matplotlib.__version__ Out [68]:'0.90.1' |Diagrammes|[69]plot(arange(6)) Out [69]:[matplotlib.lines.Line2D instance at 0x8cd0b2c] |Diagrammes|[70]savefig('tutu.pdf') --- type 'exceptions.AttributeError'Traceback (most recent call last) /home/lionel/Diagrammes/ipython console in module() /usr/lib/python2.5/site-packages/matplotlib/pylab.py in savefig(*args, **kwargs) 794 def savefig(*args, **kwargs): 795 fig = gcf() -- 796 return fig.savefig(*args, **kwargs) 797 if Figure.savefig.__doc__ is not None: 798 savefig.__doc__ = dedent(Figure.savefig.__doc__) /usr/lib/python2.5/site-packages/matplotlib/figure.py in savefig(self, *args, **kwargs) 757 kwargs[key] = rcParams['savefig.%s'%key] 758 -- 759 self.canvas.print_figure(*args, **kwargs) 760 761 def colorbar(self, mappable, cax=None, **kw): /usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 495 if printfunc is not None: 496 try: -- 497 printfunc(filename, dpi, facecolor, edgecolor, orientation, **kwargs) 498 except: 499 # restore the original figure properties /usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 1393 self.figure.draw(renderer) 1394 renderer.finalize() - 1395 file.close() 1396 1397 class FigureManagerPdf(FigureManagerBase): /usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in close(self) 399 # objects 400 self.endStream() -- 401 self.writeFonts() 402 self.writeObject(self.alphaStateObject, 403 dict([(val[0], val[1]) /usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in writeFonts(self) 454 fontdictObject = self._write_afm_font(filename) 455 else: -- 456 fontdictObject = self.embedTTF(filename) 457 fonts[Fx] = fontdictObject 458 #print sys.stderr, filename /usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in embedTTF(self, filename) 506 width = font.load_char(unicode, flags=LOAD_NO_SCALE).horiAdvance 507 return cvt(width) -- 508 widths = [ get_char_width(charcode) for charcode in range(firstchar, lastchar+1) ] 509 510 widthsObject = self.reserveObject('font widths') /usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in get_char_width(charcode) 503 firstchar, lastchar = 0, 255 504 def get_char_width(charcode): -- 505 unicode = cp1252.decoding_map[charcode] or 0 506 width = font.load_char(unicode, flags=LOAD_NO_SCALE).horiAdvance 507 return cvt(width) type 'exceptions.AttributeError': 'module' object has no attribute 'decoding_map' -- Lionel Roubeyrie - [EMAIL PROTECTED] Chargé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] record array and date support
Hi John, very very interesting idea. Is there a way to add some extras informations on the records arrays columns, like the units or/and the desired labels for the resulting plotted lines, directly retrieved in the CSV files? Cordialy Le jeudi 07 juin 2007, John Hunter a écrit : I just added support for native plotting of python date and datetime objects (you still can, but don't have to use plot_date with date2num conversions). We will continue to do conversion to floats under the hood, but the conversion can be handled automagically. I also added support for loading CSV files (or general space/tab/comma delimited files) into numpy record arrays, and the type conversions (int, float, date, etc...) happen automagically. The function assumes there is a header row, and these strings will be munged to give valid python attribute names. It inspects the first checkrows lines after the header to try and infer the datatype and set the appropriate conversion function. It's not entirely bullet proof, but it should cover a lot of common use cases. Here is an example (svn only) from matplotlib.mlab import csv2rec from pylab import figure, show a = csv2rec('data/msft.csv') fig = figure() ax = fig.add_subplot(111) ax.plot(a.date, a.adj_close, '-') fig.autofmt_xdate() show() The autofmt_xdate is optional, but is a new function that does a few things you usually want in date plots: turns off tick labels in the upper subplots if any, rotates the tick labels on the lowest axes and right aligns them, and increases the bottom of the subplots adjust to make room for the rotated tick labels. Here is what the dtype looks like from the example above. In [3]: !head -3 data/msft.csv Date,Open,High,Low,Close,Volume,Adj. Close* 19-Sep-03,29.76,29.97,29.52,29.96,92433800,29.79 18-Sep-03,28.49,29.51,28.42,29.50,67268096,29.34 In [4]: a = csv2rec('data/msft.csv') In [5]: a.dtype Out[5]: dtype([('date', '|O4'), ('open', 'f8'), ('high', 'f8'), ('low', 'f8'), ('close', 'f8'), ('volume', 'i4'), ('adj_close', 'f8')]) In [6]: a.date[:2] Out[6]: array([2003-09-19 00:00:00, 2003-09-18 00:00:00], dtype=object) I'll probably add a few performance features to the csv2rec function, mainly to let you skip columns and supply conversion functions where desired because the autodate parser is pretty slow if you want to parse date strings, but this is enough to make it useful. Another useful feature will be able to support customizable type dependent NULL value conversion (eg convert to numpy.nan for floats, '-00-00' for dates, etc...) Record arrays are your friend; have fun! JDH - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting wind-speed time series
Good news. When the next production version will be released? Le Jeudi 10 Mai 2007 15:47, John Hunter a écrit : I recently added legend support for polar to matplotlib svn. JDH - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] grd file
Le Vendredi 20 Avril 2007 18:10, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: By grd file, I mean csv like file, with one line by value, like X1 Y1 Z1 X2 Y1 Z2 X3 Y1 Z3 ... X1 Y2 Zk X2 Y2 Zk+1 ... Xi Yj Zn this is in geographic format, where there is a repetition in the X values and the Y values, because the grid is regular, but not in lambert projection, then I can't retrieve the dimensions of the grid. [SNIP] Lionel: Well, I guess you are stuck without knowing what the dimensions of the grid are. Can't you find that out from the data provider? -Jeff Hi Jeff, sorry for the latency. Problems come from the implementation of GMT into our programs, which only uses Lambert coords, and we are now with a deadlock. We're going to replace it by MPL because we believe in it and we think it's the better way to make plots and maps, so if for that we have to rewrite all the codes, we can then try to catch geographic coords instead of Lambert. Thanks for your help, and for basemap too. -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] grd file
hi all, is there a way to plot (contourf) a .grd file from GMT directly with Basemap? I have a problem with contourf because I can't reshape to 2D the Z values ,x and y are in Lambert projection, so I can't compute the shape :-( thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] grd file
By grd file, I mean csv like file, with one line by value, like X1 Y1 Z1 X2 Y1 Z2 X3 Y1 Z3 ... X1 Y2 Zk X2 Y2 Zk+1 ... Xi Yj Zn this is in geographic format, where there is a repetition in the X values and the Y values, because the grid is regular, but not in lambert projection, then I can't retrieve the dimensions of the grid. Le Vendredi 20 Avril 2007 14:54, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi Jeff, yes, lambert is not the problem, you're right. I have some .grd files with x,y,z values, and I want to project z values on maps and interpolate them. I don't have the dimensions of the shape, but with m.scatter(x, y, z), I see that the scatters are displayed in a regular grid. Then is there a way to retrieve the dimensions of the resulting grid, and then I can reshape z to pass it to contourf? Lionel: There should be an attribute or attributes in the netCDF file that specify the dimensions of the grid (at least there should be, according to the GMT documentation). I tried to convert x and y to degrees, hoping removing the duplicated entries (with rouding) gives me the dimensions, but I also have a problem with m(x,y,inverse=True), because the results are not good ( I use m = Basemap(llcrnrlon=0.5, llcrnrlat=44.8, urcrnrlon=2.8, urcrnrlat=46.5, projection='lcc', lat_1=45.89891889,lat_2=47.69601444,lon_0=2.33722917)). thanks You shouldn't need to do that - just pass x,y and the reshaped z to contourf. You do need to know the parameters of the projection though. -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Basemap 3D
Hi Jeff, I want to display some pollutants concentrations saved in shapefiles on maps displayed in 3D. You can have a look of what I need here: http://rockware.com/catalog/pages/arcgis3dfeat1.html, in the last image. Le Jeudi 12 Avril 2007 16:40, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi all, not sure it's possible, I can't find any example but I ask : is there a way to make some 3D maps with Basemap, like we can do with ArcScene (ESRI), mixing rasters or shapefiles with TINs? If no, do you know a way to do so with python? Thanks Lionel: I don't know, but I honestly doubt it. Matplotlib is fundamentally a 2-D package, there is a bit of mostly unsupported 3-D stuff that has been bolted on. Can you be more specific about what you mean though? Perhaps a link to an example? I have had good luck with ncvtk (http://ncvtk.sourceforge.net/), but I think it only really works if your data is global and in a netCDF file. -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Basemap 3D
Hi all, not sure it's possible, I can't find any example but I ask : is there a way to make some 3D maps with Basemap, like we can do with ArcScene (ESRI), mixing rasters or shapefiles with TINs? If no, do you know a way to do so with python? Thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PDF and accentued characters
Oups, sorry for the mistake, the Vera font in the resulting pdf file from epstopdf is effectively converted to T3Font_0 Type 3. You can have a look here: http://www.limair.asso.fr/share/pre2.eps and http://www.limair.asso.fr/share/pre2.pdf Thanks Le Lundi 26 Février 2007 19:38, Jouni K. Seppänen a écrit : Lionel Roubeyrie [EMAIL PROTECTED] writes: Fonts are BitStream VeraSans-Roman, TrueType. Then this is not the usual font problem where fonts get converted either into Type 3 or into raw drawing commands. Can you put example files (both eps and pdf) on some website so we can try to understand what is wrong with them? -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] PDF and accentued characters
Hi, sorry to resend this problem, I didn't have any response and the problem always exists, all accentued characters are set to ? when I save figures in pdf format. Does someone have a solution to that? MPL 0.87.7 on Edgy Eft thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PDF and accentued characters
Le Lundi 26 Février 2007 12:35, Jouni K. Seppänen a écrit : Does saving the figure as eps and converting to pdf work for you? The pdf backend doesn't support unicode, since I've never been able to really understand how encoding strings in pdf works. (Nicolas Grilly's recent patch fixed something related to encodings, so perhaps he understands them better?) Patches are of course welcome. I'm afraid I'm currently too busy with my day job to do any major hacking on the pdf backend. Hi Jouni, converting eps to pdf works, but fonts are not well rendered, and I need very high quality results for our publisher. -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PDF and accentued characters
Le Lundi 26 Février 2007 14:20, Darren Dale a écrit : What are you using to do the conversion? epstopdf should maintain the integrity of the fonts. epstopdf should maintain... but not, it doesn't do that! -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PDF and accentued characters
Hi, Fonts are BitStream VeraSans-Roman, TrueType. Le Lundi 26 Février 2007 16:43, Jouni K. Seppänen a écrit : What exactly is the problem with the converted pdf file? Try opening it in Adobe Reader and viewing Document Properties / Fonts. Do you see any Type 3 fonts, and what are their names? -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PDF and accentued characters
Hi Nicolas, I just want to set xlabels with : MOIS=['janvier', u'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'aout', 'septembre', 'octobre', 'novembre', u'décembre'] resulting in 'f?vrier' and 'd?cembre' in the pdf file. Le Lundi 26 Février 2007 17:01, Nicolas Grilly a écrit : Hello Lionel, On 2/26/07, Lionel Roubeyrie [EMAIL PROTECTED] wrote: sorry to resend this problem, I didn't have any response and the problem always exists, all accentued characters are set to ? when I save figures in pdf format. Does someone have a solution to that? MPL 0.87.7 on Edgy Eft Can you send me a little test script showing what you are trying to do? I'll run it with the patched PDF backend. I use this backend daily to produce PDF files containing accentuated characters. Thanks, Nicolas - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] windrose 0.5
Hi Derek, I forgot to mention: you can pass throught your problem by using a masked array instead of a simple array, and it should work fine, the 'default' parameter is here to fill missing value by -1.e20, then these directions will be dropped if your speed_classes not include that missing value (generally we compute on positives speeds). Le Jeudi 01 Février 2007 13:17, Derek Hohls a écrit : Lionel I have encountered a problem with windrose. In some cases, one or more of the wind direction values are null [''] - the program then fails on line 200: values = select( [greater_equal( direction, wind_classes[i] )],[speed], default=-1.e20 ) Is it possible for you to upgrade the program to perform error trapping and simply skip (i.e. not process) any values that are null (and handle the exceptional case that all of them might, in fact, be null). Thanks! Derek -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] accentued characters error, superscript error
Hi, using Agg, there's problems exporting plots in pdf format, all accentued characters are not displayed (like u'accentué'), but they are in svg files. In svg files, superscript characters are set to subscript (using TeX notation). Is there solutions to these problems? thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] box and ticks
Hi, How can we remove only top and right lines of a plot, box(on=False) removes all. Same question for top and right ticks? thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] bug on bar?
Hi all, I've got a strange problem with bar, it seems that xticks are not correctly draw: |remi|[16]years Out [16]:[1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006] |remi|[17]maxis Out [17]:[137.25, 124.5, 125.125, 125.375, 176.5, 148.625, 145.875, 150.375] |remi|[18]bar(years,maxis,align='center') gives the figure in the sc.png. But if we happend one data in years and in maxis, xticks are good! Is it a bug? PS:mpl version 0.87.7. -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr sc.png Description: PNG image - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] text in axis coords
Hi all, I need to set texts on figures in axis coords, not data coords. Following text doc, transform=ax.transAxes seems not working : ## |~|[32]ax=subplot(111) |~|[33]text( 0.0, 1.0, 'text1', transform=ax.transData, color='r' ) Out [33]:matplotlib.text.Text instance at 0xb487fbec |~|[34]text( 1.0, 1.0, 'text2', transform=ax.transAxes, color='b' ) Out [34]:matplotlib.text.Text instance at 0xb488298c ## gives figure in the attached picture. Text2 must be out of figure, not here! An idea? thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr text.png Description: PNG image - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] text in axis coords
Arg, sorry, stupid question, I didn't use valid limits. Le Mardi 09 Janvier 2007 12:32, Lionel Roubeyrie a écrit : Hi all, I need to set texts on figures in axis coords, not data coords. Following text doc, transform=ax.transAxes seems not working : ## |~|[32]ax=subplot(111) | |~|[33]text( 0.0, 1.0, 'text1', transform=ax.transData, color='r' ) Out [33]:matplotlib.text.Text instance at 0xb487fbec |~|[34]text( 1.0, 1.0, 'text2', transform=ax.transAxes, color='b' ) Out [34]:matplotlib.text.Text instance at 0xb488298c ## gives figure in the attached picture. Text2 must be out of figure, not here! An idea? thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] text against colorbar
Hi all, I don't find any doc on this point, then I post my question here: is it possible to set texts with a colorbar, like a legend? You can have a look of what I want here: http://www.limair.asso.fr/previsions2/index.php (just click OK) thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] text against colorbar
Arg, I hoped that you would not say that :-) Le Mardi 19 Décembre 2006 16:39, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi all, I don't find any doc on this point, then I post my question here: is it possible to set texts with a colorbar, like a legend? You can have a look of what I want here: http://www.limair.asso.fr/previsions2/index.php (just click OK) thanks Lionel: I don't think there is any automatic way to do this, but you can do it manually with pylab.text (http://matplotlib.sourceforge.net/matplotlib.pylab.html#-text). -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] windrose 0.5
Hi Derek, yes you can, because you've got an axes instance: freq, axe= windrose.windplot( ... setp(axe.thetagridlabels,fontsize=16) #for directions setp(axe.rgridlabels,fontsize=10) #for values I want to change how windrose is called and controled, like all others matplotlib graphs. Maybe in 0.6. Le jeudi 26 octobre 2006 08:34, Derek Hohls a écrit : Lionel Is it possible to change the font sizes on the (a) direction labels (N, S, E, W) (b) % values labelling the rings? Thanks Derek -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] windrose 0.3
Le vendredi 13 octobre 2006 08:26, Derek a écrit : Lionel Roubeyrie [EMAIL PROTECTED] writes: Hi all, continuing on the windroses, here the third version of windrose.py, with two others styles (line and bar2 (is it what you want Derek?)). I want to know how it's possible to modify the legends to be on axes, and not on the figure like in the ex4.png subplots example. Lionel Looks great! Is it possible to change the size/position of the legend - the fonts certainly seem too big, and the whole box overlaps the figure. Derek Hi Derek, yes it's possible, with: freq,ax=windrose.windplot(vent['VV'],vent['DV'],counts=False,speed_classes=[1,2,3,4,5],sectors=16,style='bar') draw() fig=ax.get_figure() for leg in fig.legends: setp(leg.get_texts(), fontsize=8) - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] legend orientation
Le mardi 26 septembre 2006 14:22, John Hunter a écrit : Make sure you pass in a list of strings, and not a single string. If you have just a single string, it interprets it as a list of characters. JDH Yes, I have seen my error too late, thanks. But I can't get a line in the legend, just markers? -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] legend orientation
Le mardi 26 septembre 2006 16:29, John Hunter a écrit : I'm not sure what you are trying to do here. How about ax = subplot(111) ax.plot([1,2,3], '-', label='a line') ax.legend() I don't know if it's a normal way with mpl, but with your example or with my datas, the legend doesn't have a line beside the text, just the space for it. If I use linestyle='o', the marked is drawn. -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] masked arrays on objects arrays doesn't plot
Hi all, I use a array with dtype=object for mixing datetime and float values, like: ## lionel[ETD-2006-01__PM2.5_DALTON]68datas[0:5,] Sortie[68]: array(data = [[2006-01-05 00:00:00 33.0 1e-20] [2006-01-06 00:00:00 41.0 30.0] [2006-01-07 00:00:00 20.0 16.0] [2006-01-08 00:00:00 16.0 13.0] [2006-01-09 00:00:00 18.0 15.0]], mask = [[False False True] [False False False] [False False False] [False False False] [False False False]], fill_value=1e-20) ## but I get a error when I want to plot directly using plot_date(date2num(datas[:,0]),datas[:,1]): ## --- exceptions.TypeError Traceback (most recent call last) /home/lionel/Etudes_Techniques/ETD-2006-01__PM2.5_DALTON/ipython console /usr/lib/python2.4/site-packages/matplotlib/pylab.py in plot_date(*args, **kwargs) 2038 hold(h) 2039 try: - 2040 ret = gca().plot_date(*args, **kwargs) 2041 draw_if_interactive() 2042 except: /usr/lib/python2.4/site-packages/matplotlib/axes.py in plot_date(self, x, y, fmt, tz, xdate, ydate, **kwargs) 2159 if not self._hold: self.cla() 2160 - 2161 ret = self.plot(x, y, fmt, **kwargs) 2162 2163 if xdate: /usr/lib/python2.4/site-packages/matplotlib/axes.py in plot(self, *args, **kwargs) 2121 if not self._hold: self.cla() 2122 lines = [] - 2123 for line in self._get_lines(*args, **d): 2124 self.add_line(line) 2125 lines.append(line) /usr/lib/python2.4/site-packages/matplotlib/axes.py in _grab_next_args(self, *args, **kwargs) 308 if not is_string_like(remaining[2]): 309 raise ValueError, 'third arg must be a format string' -- 310 yield self._plot_3_args(remaining, **kwargs) 311 remaining=[] 312 continue /usr/lib/python2.4/site-packages/matplotlib/axes.py in _plot_3_args(self, tup3, **kwargs) 279 linestyle=linestyle, marker=marker, 280 markerfacecolor=color, -- 281 markeredgecolor=mec, 282 ) 283 self.set_lineprops(ret, **kwargs) /usr/lib/python2.4/site-packages/matplotlib/lines.py in __init__(self, xdata, ydata, linewidth, linestyle, color, marker, markersize, markeredgewidth, markeredgecolor, markerfacecolor, antialiased, dash_capstyle, solid_capstyle, dash_joinstyle, solid_joinstyle, **kwargs) 204 self.verticalOffset = None 205 -- 206 self.set_data(xdata, ydata) 207 208 if not self._lineStyles.has_key(linestyle): /usr/lib/python2.4/site-packages/matplotlib/lines.py in set_data(self, *args) 280 281 self._x = asarray(x, Float) -- 282 self._y = asarray(y, Float) 283 284 self._logcache = None /usr/lib/python2.4/site-packages/numpy/oldnumeric/functions.py in asarray(a, typecode, dtype) 82 def asarray(a, typecode=None, dtype=None): 83 dtype = convtypecode2(typecode, dtype) --- 84 return mu.array(a, dtype, copy=0) 85 86 def nonzero(a): TypeError: array cannot be safely cast to required type ## but the line: plot_date(date2num(datas[:,0]), ma.masked_values(datas[:,1].tolist() ,1.e-20)) works perfectly. Do I do something wrong? thanks -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] datestr2num problem
hi all, I have a problem with datestr2num. All my dates are sorted in %d/%m/%Y format, but datestr2num seems to take days for months before the 12th day: 100datas['Dates'] Sortie[100]: recarray([05/01/2006, 06/01/2006, 07/01/2006, 08/01/2006, 09/01/2006, 10/01/2006, 11/01/2006, 12/01/2006, 13/01/2006, 14/01/2006, 15/01/2006, 16/01/2006, 17/01/2006, 18/01/2006, 19/01/2006, 20/01/2006, 21/01/2006, 22/01/2006, 23/01/2006, 24/01/2006, 25/01/2006, 26/01/2006, 27/01/2006, 28/01/2006, 29/01/2006, 30/01/2006, 31/01/2006, 01/02/2006, 02/02/2006, 03/02/2006, 04/02/2006, 05/02/2006, 06/02/2006, 07/02/2006, 08/02/2006, 09/02/2006, 10/02/2006, 11/02/2006, 12/02/2006, 13/02/2006, 14/02/2006, 15/02/2006, 16/02/2006, 17/02/2006, 18/02/2006, 19/02/2006, 20/02/2006, 21/02/2006, 22/02/2006, 23/02/2006, 24/02/2006, 25/02/2006, 26/02/2006, 27/02/2006, 28/02/2006, 01/03/2006], dtype='|S10') 101array([datetime.strftime(x, %d/%m/%Y) for x in num2date(datestr2num(datas['Dates']) )]) Sortie[101]: array([01/05/2006, 01/06/2006, 01/07/2006, 01/08/2006, 01/09/2006, 01/10/2006, 01/11/2006, 01/12/2006, 13/01/2006, 14/01/2006, 15/01/2006, 16/01/2006, 17/01/2006, 18/01/2006, 19/01/2006, 20/01/2006, 21/01/2006, 22/01/2006, 23/01/2006, 24/01/2006, 25/01/2006, 26/01/2006, 27/01/2006, 28/01/2006, 29/01/2006, 30/01/2006, 31/01/2006, 02/01/2006, 02/02/2006, 02/03/2006, 02/04/2006, 02/05/2006, 02/06/2006, 02/07/2006, 02/08/2006, 02/09/2006, 02/10/2006, 02/11/2006, 02/12/2006, 13/02/2006, 14/02/2006, 15/02/2006, 16/02/2006, 17/02/2006, 18/02/2006, 19/02/2006, 20/02/2006, 21/02/2006, 22/02/2006, 23/02/2006, 24/02/2006, 25/02/2006, 26/02/2006, 27/02/2006, 28/02/2006, 03/01/2006], dtype='|S10') -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap plots
HI, how do you set the arrows on the bottom and the top of your colorbar? I don't find any option for that? Thanks Le Vendredi 07 Juillet 2006 10:11, [EMAIL PROTECTED] a écrit : On Friday 07 July 2006 4:11 pm, Lionel Roubeyrie wrote: Hi all, Is it possible to import colormap file from GMT (.cpt) to basemap? If yes how can we do that? Thanks It's possible. Here's how I've been doing it. (1) I use the gmtcolormapPylab function defined in: http://sourceforge.net/mailarchive/message.php?msg_id=11255878 (2) Using the above function and a GMT cpt file (e.g. GMT_no_green.cpt), I set a color dictionary as: cdict = gmtcolormapPylab(GMT_no_green) (3) I define a colormap using: mycmap = cm.colors.LinearSegmentedColormap(GMT_no_green,cdict,256) (4) I apply the above using cmap=mycolormap in contourf or pcolormesh. By the way, in case you don't know of the following site, it has an exhaustive selection of color palettes: http://cpt-city.org.uk/ I've also attached an example of a basemap image using a cpt from the above site. Masked values not defined by the colormap are shown in gray. -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap plots
Work very fine here, thanks for the links. Le Vendredi 07 Juillet 2006 10:11, [EMAIL PROTECTED] a écrit : On Friday 07 July 2006 4:11 pm, Lionel Roubeyrie wrote: Hi all, Is it possible to import colormap file from GMT (.cpt) to basemap? If yes how can we do that? Thanks It's possible. Here's how I've been doing it. (1) I use the gmtcolormapPylab function defined in: http://sourceforge.net/mailarchive/message.php?msg_id=11255878 (2) Using the above function and a GMT cpt file (e.g. GMT_no_green.cpt), I set a color dictionary as: cdict = gmtcolormapPylab(GMT_no_green) (3) I define a colormap using: mycmap = cm.colors.LinearSegmentedColormap(GMT_no_green,cdict,256) (4) I apply the above using cmap=mycolormap in contourf or pcolormesh. By the way, in case you don't know of the following site, it has an exhaustive selection of color palettes: http://cpt-city.org.uk/ I've also attached an example of a basemap image using a cpt from the above site. Masked values not defined by the colormap are shown in gray. -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap plots
Arg, sorry, I have found the response by myself, I just have to use figure.add_subplot to fix it. Le Vendredi 07 Juillet 2006 15:14, Lionel Roubeyrie a écrit : Hi Jeff, thanks for the hint, I just need to import one personal GMT file maked a time ago and used in a plotting project based on GMT, which I try to convert to matplotlib. Now I have a little problem to plot a basemap with subplots. Trying to use contour_demo.py mixed with hist.py to have a map with contours and under it an histogram of values, I can't set the colorbar else I loose the map. I think I have a problem with axes but I'm not very familar with subplotting. Have you an idea of how can I do that? Le Vendredi 07 Juillet 2006 13:53, Jeff Whitaker a écrit : Lionel Roubeyrie wrote: Hi all, Is it possible to import colormap file from GMT (.cpt) to basemap? If yes how can we do that? Thanks Lionel: I had included the GMT colormaps in matplotlib, but had to take them out because of licensing issues. If you want to put them back in, put the attached file in your matplotlib install directory sys.prefix/lib/python2.4/site-packages/matplotlib. Then use a text editor to add the following lines to _cm.py (in the same directory) from gmt_cm import addcmaps addcmaps(datad) right above the line # reverse all the colormaps. This will give you the colormaps GMT_gebco GMT_globe GMT_haxby GMT_no_green GMT_ocean GMT_polar GMT_red2green GMT_relief GMT_seis GMT_wysiwyg and the corresponding reversed colormaps (with '_r' appended to the name). -Jeff -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users