SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Malte M. <Mal...@cs...> - 2006年03月30日 23:42:20
You are looking for
matplotlib.axes.Subplot.set_position
set_position(self, pos) method of matplotlib.axes.Subplot instance
 Set the axes position with pos = [left, bottom, width, height]
 in relative 0,1 coords
 ACCEPTS: len(4) sequence of floats
axes_top.set_position([left, bottom, width, height])
etc.
On Friday 31 March 2006 08:38, Andrew B. Young wrote:
> Hello:
>
> How does one go about controlling the size of a subplot?
> I've got--
>
> figure = matplotlib.pylab.Figure()
> canvas = FigureCanvas( figure )
> axes_top = figure.add_subplot(211)
> axes_bottom = figure.add_subplot(212)
>
> and I want the _top to occupy 4/5 of the png
> and the _bottom to occupy the remaining 1/5.
>
> Thanks!
> Andrew
From: John H. <jdh...@ac...> - 2006年03月30日 23:52:22
>>>>> "Malte" == Malte Marquarding <Mal...@cs...> writes:
 Malte> You are looking for matplotlib.axes.Subplot.set_position
That will work, but what you are really looking for is to not use
subplot at all, but rather axes; a Subplot is just an Axes that happens
to lie on a regular grid
 axes_top = fig.add_axes([0.1, 0.3, 0.8, 0.6])
 axes_bottom = fig.add_axes([0.1, 0.1, 0.8, 0.15])
If you want the two axes to touch and share and xaxis, see
examples/ganged_plots.py. There are nice tricks you can do to share
an xaxis so for example when you pan/zoom in one the xaxis in both
plots move together; see examples/shared_axis_demo.py
JDH
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /