From: Bala s. <bal...@gm...> - 2009-03-27 12:31:04
|
Dear Friends, I am new to matplotlib. Just started with it. I have some queries, kindly help me to understand the following. i) How are pyplot and pylab are related. Is there any advantage of one over the other. In the matplotlib homepage examples are shown with both pyplot and pylab ii) How can i generage multi y-axes plot ie x y1 y2 y3 (with same x values). any small example script would be of much help to me. iii) How to save the figure with a name. By default in which format the figure is saved ? Thanks in advance, Bala |
From: John H. <jd...@gm...> - 2009-03-27 12:54:05
|
On Fri, Mar 27, 2009 at 7:30 AM, Bala subramanian <bal...@gm... > wrote: > Dear Friends, > > I am new to matplotlib. Just started with it. I have some queries, kindly > help me to understand the following. > Welcome! > > i) How are pyplot and pylab are related. Is there any advantage of one over > the other. In the matplotlib homepage examples are shown with both pyplot > and pylab > See this FAQ: http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related > > ii) How can i generage multi y-axes plot ie x y1 y2 y3 (with same x > values). any small example script would be of much help to me. > plot([x,x,x], [y1, y2, y2], 'o') See also this tutorial: http://matplotlib.sourceforge.net/users/pyplot_tutorial.html > > iii) How to save the figure with a name. By default in which format the > figure is saved ? > savefig('somefile.png') or savefig('somefile.pdf') etc. The extension determines the file format. For details see http://matplotlib.sourceforge.net/faq/installing_faq.html#backends Hope this helps, JDH |
From: Bala s. <bal...@gm...> - 2009-03-27 17:15:13
|
Dear All, I have to make multiple plot on the same page. Six row and three column. Kindly suggest me some tips to do the same. Bala |
From: Ryan M. <rm...@gm...> - 2009-03-27 17:39:24
|
On Fri, Mar 27, 2009 at 12:15 PM, Bala subramanian < bal...@gm...> wrote: > Dear All, > > I have to make multiple plot on the same page. Six row and three column. > Kindly suggest me some tips to do the same. > Try: pyplot.subplot() http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplot Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. |
From: John H. <jd...@gm...> - 2009-03-27 17:44:46
|
On Fri, Mar 27, 2009 at 12:15 PM, Bala subramanian < bal...@gm...> wrote: > > I have to make multiple plot on the same page. Six row and three column. > Kindly suggest me some tips to do the same. This is covered in the tutorial I referred you to in my first response, http://matplotlib.sourceforge.net/users/pyplot_tutorial.html specifically the section "Working with multiple figures and axes" http://matplotlib.sourceforge.net/users/pyplot_tutorial.html#working-with-multiple-figures-and-axes To make six rows and three columns, you do subplot(6,3,1) subplot(6,3,2) ... subplot(6,3,18) See also the documentation for the subplot command http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplot JDH |
From: Fabrice S. <si...@lm...> - 2009-03-27 18:00:29
|
Le vendredi 27 mars 2009 à 18:15 +0100, Bala subramanian a écrit : > I have to make multiple plot on the same page. Six row and three > column. Kindly suggest me some tips to do the same. I suggest you to have a look to the matplotlib gallery, in particular this example http://matplotlib.sourceforge.net/examples/pylab_examples/psd_demo2.html You need to define subplots using the pyplot interface http://matplotlib.sourceforge.net/api/pyplot_api.html?#matplotlib.pyplot.subplot or the matplotlib API http://matplotlib.sourceforge.net/api/axes_api.html?#matplotlib.axes.Subplot With many subplots, you may pay attention with the figure size, that you can define with the 'figsize' and 'dpi' keyword arguments of the figure function : http://matplotlib.sourceforge.net/api/pyplot_api.html?#matplotlib.pyplot.figure -- Fabrice Silva <si...@lm...> LMA UPR CNRS 7051 |