Figure size with subplots

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Figure size with subplots

karl
Hi all,

I have a simple question about subplots.
If I write:

x=linspace(0,50,4);
subplot(1,2,1);
plot(x,x.^2);
subplot(1,2,2);
plot(x,x.^4);

I get two very tall and narrow plots in a quadratic window.
How to change the size of the window that I have two plots of quadratic size
in a rectangular window whose height is half the width?

Thanks!

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Figure size with subplots

Mike Miller-4
On Sun, May 22, 2016 at 09:18:10 +0200, karl wrote:
> How to change the size of the window that I have two plots of quadratic size
> in a rectangular window whose height is half the width?

The figure size and position are controlled with the "position" property
of the figure object.

To set the height of the figure window to be half of what it is
currently,

  pos = get (gcf, "position");
  pos(4) = pos(4) / 2;
  set (gcf, "position", pos);

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave