Squared contour plot

Hi all,
I'm quite new to matplotlib and I'm trying to do some squared contour plots (I mean contour plots with the same scale for both axes). However, any attempt has failed. How can I get a plot with an aspect ratio equals 1?

Thanks in advance,
  Andrea

Andrea Riciputi wrote:

Hi all,
I'm quite new to matplotlib and I'm trying to do some squared contour plots (I mean contour plots with the same scale for both axes). However, any attempt has failed. How can I get a plot with an aspect ratio equals 1?

Thanks in advance,
Andrea

Andrea: The matplotlib default figure size is not square. To remedy this, you can either edit your .matplotlibrc and set (for example)

figure.subplot.left : 0.1 # the left side of the subplots of the figure
figure.subplot.right : 0.9 # the right side of the subplots of the figure
figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure
figure.subplot.top : 0.9 # the top of the subplots of the figure

or do the same manually in your script via

fig.set_figsize_inches((8,8)) # default is (8,6)

You might also have to use the set_xlim and set_ylim axes methods to make sure the axis limits are set to be the same.

HTH,

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory