[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting the canvas/image size of plot in Octave
From: |
Ben Abbott |
Subject: |
Re: Setting the canvas/image size of plot in Octave |
Date: |
Mon, 15 Apr 2013 08:06:47 -0400 |
On Apr 15, 2013, at 2:25 AM, sayaliskulkarni wrote:
> Hello,
>
> Am trying to plot multiple subplots in a single main plot. But this is
> making the plots to cluttered. To avoid this I want to increase the window
> size/canvas size of the main plot. I guess it is set to some default
> resolution? How to change that?
>
> Sample code below:
> (this has total 9 plots - 3 rows x 3 columns. Now this can be even more -
> say 10 rows, 3 columns. So I want to ensure that the plot height is more in
> such cases, or width is more, as required)
>
>
> subplot (3, 3, 1); x=[ 1 3 1]; bar(x); title ("title1"); set (gca, 'xtick',
> [ 1 2 3]);set (gca, 'xticklabel', {'label11','label12','label13'}) ;
> subplot (3, 3, 2); x=[ 2 1 1 1]; bar(x); set (gca, 'xtick', [ 1 2 3 4]);set
> (gca, 'xticklabel', {'label21','label22','label23','label24'}) ;
> subplot (3, 3, 3); x=[ 3 1 1]; bar(x); set (gca, 'xtick', [ 1 2 3]);set
> (gca, 'xticklabel', {'4','2','0'}) ;
> subplot (3, 3, 4); x=[ 3 10 2]; bar(x); title ("title2"); set (gca, 'xtick',
> [ 1 2 3]);set (gca, 'xticklabel', {'label11','label12','label13'}) ;
> subplot (3, 3, 5); x=[ 13 1 1]; bar(x); set (gca, 'xtick', [ 1 2 3]);set
> (gca, 'xticklabel', {'label21','label22','label23'}) ;
> subplot (3, 3, 6); x=[ 5 6 2 1 1]; bar(x); set (gca, 'xtick', [ 1 2 3 4
> 5]);set (gca, 'xticklabel', {'4','3','2','1','0'}) ;
> subplot (3, 3, 7); x=[ 2 8 1]; bar(x); title ("title3"); set (gca, 'xtick',
> [ 1 2 3]);set (gca, 'xticklabel', {'label11','label12','label13'}) ;
> subplot (3, 3, 8); x=[ 8 1 2]; bar(x); set (gca, 'xtick', [ 1 2 3]);set
> (gca, 'xticklabel', {'label21','label22','label23'}) ;
> subplot (3, 3, 9); x=[ 1 2 5 1 1 1]; bar(x); set (gca, 'xtick', [ 1 2 3 4 5
> 6]);set (gca, 'xticklabel', {'5','4','3','2','1','0'}) ;
> print '/tmp/testRun.png';
>
> Thanks in advance for the help.
> Regards
> Sayali
I had some trouble running your script (it got scambled via email, I think).
I've attached a corrected one for anyone interested.
If you are running Octave 3.6.x, then I recommend you try using the fltk
graphics toolkit instead of gnuplot. The fltk toolkit will modify the axes
widths and heights to avoid having the titles, and axes labels from over
lapping. Just run the commands below and then run your script.
close all
graphics_toolkit fltk
Ben
sayali.m
Description: Binary data