joined matplotlib today

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

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

···

On Fri, Mar 27, 2009 at 7:30 AM, Bala subramanian <bala.biophysics@…287…> 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.

Bala

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

···

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.

--
Fabrice Silva <silva@...1918...>
LMA UPR CNRS 7051

Try: pyplot.subplot()

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplot

Ryan

···

On Fri, Mar 27, 2009 at 12:15 PM, Bala subramanian <bala.biophysics@…287…> 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.


Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from: Norman Oklahoma United States.

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

···

On Fri, Mar 27, 2009 at 12:15 PM, Bala subramanian <bala.biophysics@…287…> 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.