[Matplotlib-users] scatter plot without edge color
Dear all, how can I make a scatter plot without edgecolor? import matplotlib.pyplot as plt In [110]: plt.scatter(np.arange(10),np.arange(10,20),edgecolor=None) Out[110]: matplotlib.collections.CircleCollection object at 0x5cf16d0 in this case I can use edgecolor='w' to solve it, but when points overlap, this does not work anymore. Any help will be appreciated. Thanks. Chao -- *** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] scatter plot without edge color
Hi Chao! On Oct 15, 2011, at 2:55 PM, Chao YUE wrote: import matplotlib.pyplot as plt In [110]: plt.scatter(np.arange(10),np.arange(10,20),edgecolor=None) Out[110]: matplotlib.collections.CircleCollection object at 0x5cf16d0 in this case I can use edgecolor='w' to solve it, but when points overlap, this does not work anymore. Any help will be appreciated. Thanks. For scatter plots, I usually use: plt.plot(x,y,'.') You can manipulate a bit the marker, markersize, style and alpha parameters (nice when there are really too many points overlapping, to get an idea of the distribution). In your ipython, type plot? to get all the available options. Cheers, jean-louis Chao -- *** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] scatter plot without edge color
On Sat, Oct 15, 2011 at 8:55 AM, Chao YUE chaoyue...@gmail.com wrote: Dear all, how can I make a scatter plot without edgecolor? import matplotlib.pyplot as plt In [110]: plt.scatter(np.arange(10),np.arange(10,20),edgecolor=None) Out[110]: matplotlib.collections.CircleCollection object at 0x5cf16d0 in this case I can use edgecolor='w' to solve it, but when points overlap, this does not work anymore. Any help will be appreciated. Thanks. Hi Chao, I think what you want is 'none': plt.scatter(np.arange(10),np.arange(10,20), color='y',edgecolor='none') It's confusing, but None is used to let matplotlib auto-select the color, while 'none' is used to turn off edge coloring. Best, -Tony -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] question about tight_layout()
Figure.tight_layout() is a correct way. Do you see that error only when you use Figure.tight_plot (and not when you use plt.tight_layout)? What happen you try the script below. import matplotlib.pyplot as plt fig = plt.figure(1)ax = fig.add_subplot(111)fig.tight_layout() Regards, -JJ On Sat, Oct 15, 2011 at 9:13 AM, C M cmpyt...@gmail.com wrote: Just trying out the latest mpl 1.1.0 and the tight_layout() method. I saw the guide written about it, but am a unsure how to use this when using the OO approach to using Matplotlib. When using pyplot, the method is: plt.tight_layout(). When using the OO form of mpl, is it: figure.tight_layout() ? I assume it is, because I tried this and it didn't give me a name error, but I did get an error: ValueError: left cannot be = right. What am I doing wrong? Thanks, Che -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] scatter plot without edge color
cool. it's done!! Thanks!!! Chao 2011/10/15 Tony Yu tsy...@gmail.com On Sat, Oct 15, 2011 at 8:55 AM, Chao YUE chaoyue...@gmail.com wrote: Dear all, how can I make a scatter plot without edgecolor? import matplotlib.pyplot as plt In [110]: plt.scatter(np.arange(10),np.arange(10,20),edgecolor=None) Out[110]: matplotlib.collections.CircleCollection object at 0x5cf16d0 in this case I can use edgecolor='w' to solve it, but when points overlap, this does not work anymore. Any help will be appreciated. Thanks. Hi Chao, I think what you want is 'none': plt.scatter(np.arange(10),np.arange(10,20), color='y',edgecolor='none') It's confusing, but None is used to let matplotlib auto-select the color, while 'none' is used to turn off edge coloring. Best, -Tony -- *** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] instance check, finding figure elements
I'm building plots in stages using several different functions. Since the figure contains all information, I don't hand handles to individual elements around. What's the best way to check for a specific plot element? using isinstance, or are there specific attributes that could be checked? For example, I want to add a colorbar to the figure corresponding to the first axis.imshow: images = [c for ax in f.axes for c in ax.get_children() if isinstance(c, mpl.image.AxesImage)] images [matplotlib.image.AxesImage object at 0x08C0CAD0] f.colorbar(images[0]) matplotlib.colorbar.Colorbar instance at 0x08E033F0 f matplotlib.figure.Figure object at 0x08B614D0 example using recipe http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html https://lh5.googleusercontent.com/-rpw4NHbXvxM/TpmnumYNcRI/AK0/5zLnnUPjg0A/corrmatrixgrid.png Thanks, Josef -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] instance check, finding figure elements
On Sat, Oct 15, 2011 at 10:39 AM, josef.p...@gmail.com wrote: I'm building plots in stages using several different functions. Since the figure contains all information, I don't hand handles to individual elements around. What's the best way to check for a specific plot element? using isinstance, or are there specific attributes that could be checked? Checkout out Artist.findobj http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.artist.Artist.findobj Artist is the base class for everything in a matplotlib figure, the Figure, Axes, Axis, Text, Line2D, Polygon, etc, all derive from Artist, so you can call this method on any mpl object to recursively search for objects of a given type. By recursive, I mean search the objects children, their children, etc. See also http://matplotlib.sourceforge.net/users/artists.html for more info on the artist hierarchy. But for your specific example, each axes has an `images` attribute, which is a list of images it contains (this is detailed in the artist tutorial linked above, so you could simplify your code with something like: images = np.concatenate([ax.images for ax in fig.axes]) JDH -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] question about tight_layout()
On Sat, Oct 15, 2011 at 10:15 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote: Figure.tight_layout() is a correct way. Do you see that error only when you use Figure.tight_plot (and not when you use plt.tight_layout)? Yes. What happen you try the script below. import matplotlib.pyplot as plt fig = plt.figure(1)ax = fig.add_subplot(111)fig.tight_layout() That runs without error. However, I can't get it to work correct with Figure. I'm either getting that same error or failure to adjust the Figure's size to accommodate the axes' labels. I attach a minimal runnable sample that demonstrates these problems for those that embed in wxPython. Thanks, Che testing_tight_layout.py Description: Binary data -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users