## Re: [Matplotlib-users] How to combine in one plot a plot and a circle.

 Re: [Matplotlib-users] How to combine in one plot a plot and a circle. From: Benjamin Root - 2011-10-28 17:00:08 Attachments: Message as HTML ```On Fri, Oct 28, 2011 at 11:47 AM, Gousios George wrote: > Hello , i wanted to ask how can i do what i am saying in title. > > I have a plot with some points and i have a circle. > I want to combine both data in one plot.(a circle and point data) > > I can't do it because ( i think) for the circle i use pylab.show() but > for plot ,just show(). > Is there another way to make the circle? > > > from scitools.std import * > > import pylab > > > > > > npoints=10 > > > > vectorpoint=random.uniform(-1,1,[1,2]) > > experiment=random.uniform(-1,1,[npoints,2]) > > > > #plot(experiment[:,0],experiment[:,1],'ro') > > #show() > > > > plot(experiment[:,0],experiment[:,1],'ro') > > hold('on') > > circ = pylab.Circle((0., 0.), 1.0,alpha=0.1) > > pylab.gca().add_patch(circ) > > pylab.axis('scaled') > > pylab.show() > > Thanks! > > try this: pylab.plot(experiment[:, 0], experiment[:, 1], 'ro') circ = pylab.Circle((0., 0.), 1.0, alpha=0.1) pylab.gca().add_patch(circ) pylab.axis('scaled') pylab.show() Cheers! Ben Root > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@... Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ```

 [Matplotlib-users] How to combine in one plot a plot and a circle. From: Gousios George - 2011-10-28 16:48:07 ```Hello , i wanted to ask how can i do what i am saying in title. I have a plot with some points and i have a circle. I want to combine both data in one plot.(a circle and point data) I can't do it because ( i think) for the circle i use pylab.show() but for plot ,just show(). Is there another way to make the circle? > from scitools.std import * > import pylab > > > npoints=10 > > vectorpoint=random.uniform(-1,1,[1,2]) > experiment=random.uniform(-1,1,[npoints,2]) > > #plot(experiment[:,0],experiment[:,1],'ro') > #show() > > plot(experiment[:,0],experiment[:,1],'ro') > hold('on') > circ = pylab.Circle((0., 0.), 1.0,alpha=0.1) > pylab.gca().add_patch(circ) > pylab.axis('scaled') > pylab.show() Thanks! ```
 Re: [Matplotlib-users] How to combine in one plot a plot and a circle. From: Benjamin Root - 2011-10-28 17:00:08 Attachments: Message as HTML ```On Fri, Oct 28, 2011 at 11:47 AM, Gousios George wrote: > Hello , i wanted to ask how can i do what i am saying in title. > > I have a plot with some points and i have a circle. > I want to combine both data in one plot.(a circle and point data) > > I can't do it because ( i think) for the circle i use pylab.show() but > for plot ,just show(). > Is there another way to make the circle? > > > from scitools.std import * > > import pylab > > > > > > npoints=10 > > > > vectorpoint=random.uniform(-1,1,[1,2]) > > experiment=random.uniform(-1,1,[npoints,2]) > > > > #plot(experiment[:,0],experiment[:,1],'ro') > > #show() > > > > plot(experiment[:,0],experiment[:,1],'ro') > > hold('on') > > circ = pylab.Circle((0., 0.), 1.0,alpha=0.1) > > pylab.gca().add_patch(circ) > > pylab.axis('scaled') > > pylab.show() > > Thanks! > > try this: pylab.plot(experiment[:, 0], experiment[:, 1], 'ro') circ = pylab.Circle((0., 0.), 1.0, alpha=0.1) pylab.gca().add_patch(circ) pylab.axis('scaled') pylab.show() Cheers! Ben Root > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@... Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ```