From: Eric E. <ems...@ob...> - 2006-05-19 16:47:34
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> I think there is a bug with the new verts because it cannot then use "scales" with len(scales)=1.:<br> <br> /usr/lib/python2.4/site-packages/matplotlib/axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, faceted, verts, **kwargs)<br> 3072 #scales = sqrt(scales * self.figure.dpi.get() / 72.)<br> 3073 if len(scales)==1:<br> -> 3074 verts = [s[0]*verts]<br> <br> Eric<br> <br> <br> John Hunter wrote: <blockquote cite="mid...@pe..." type="cite"> <blockquote type="cite"> <blockquote type="cite"> <blockquote type="cite"> <blockquote type="cite"> <blockquote type="cite"> <pre wrap="">"Eric" == Eric Emsellem <a class="moz-txt-link-rfc2396E" href="mailto:ems...@ob..."><ems...@ob...></a> writes: </pre> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> <pre wrap=""><!----> Eric> Hi again, I am trying to see if I could produce a scatter Eric> plot (using "scatter" or "plot") but using NEW symbols (so Eric> not already available in the list provided). I would like to Eric> design new symbols (in some way which is to be defined) so Eric> that scatter and/or plot would be able to use them. Eric> Examples: horizontal or vertical or even rotated ellipses, Eric> icon sketched galaxy-looking symbols, ... Eric> Any hint on how to do this? Eric> thanks in advance for any help here! Eric> Eric P.S.: I already posted a similar question a few days Eric> ago, so forgive me for this repetition... persistence wins the day! I added an option to scatter to support custom markers. You pass in a list if x,y vertices for the polygon you want to use as the marker. I haven't quite worked out the scaling yet, so for now use scale arguments that look right and understand that this may change when we get the scaling issue cleaned up. I added an example to svn revision 2402 examples/scatter_custom_symbol.py. Here it is, using an ellipse from pylab import figure, nx, show # unit area ellipse rx, ry = 3., 1. area = rx * ry * nx.pi theta = nx.arange(0, 2*nx.pi+0.01, 0.1) verts = zip(rx/area*nx.cos(theta), ry/area*nx.sin(theta)) x,y,s,c = nx.rand(4, 30) s*= 10**2. fig = figure() ax = fig.add_subplot(111) ax.scatter(x,y,s,c,marker=None,verts =verts) show() One thing we can do to make this more user friendly is to add new symbols to the scatter symbol table, eg 'wellipse' : a wide ellipse 'tellipse' : a tall ellipse and map names to sequences of vertices. So as you create the custom symbols you want to use, send them to me and I'll add them to the defaults, where appropriate. Cheers, JDH </pre> </blockquote> <br> <pre class="moz-signature" cols="72">-- ==================================================================== Eric Emsellem <a class="moz-txt-link-abbreviated" href="mailto:ems...@ob...">ems...@ob...</a> Centre de Recherche Astrophysique de Lyon 9 av. Charles-Andre tel: +33 (0)4 78 86 83 84 69561 Saint-Genis Laval Cedex fax: +33 (0)4 78 86 83 86 France <a class="moz-txt-link-freetext" href="http://www-obs.univ-lyon1.fr/eric.emsellem">http://www-obs.univ-lyon1.fr/eric.emsellem</a> ==================================================================== </pre> </body> </html> |