help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subplot size


From: Francesco Potortì
Subject: Re: Subplot size
Date: Fri, 21 Feb 2020 10:27:44 +0100

>I would like to plot multiple subplots in a single figure.  Because of the
>large number of graphs I want to suppress all labels from the horizontal
>axis, except the bottom one, and reduce the space between the graphs.
>According to the documentation the 'position' parameter in the subplot can
>be used to define location and size of each subplot.   

By trial and error I managed to get to this (works on Octave 5.2.0 on
Linux with fltk):

m = 8;
d = rand(100,m);
rnge = 1:100;
figure (1), clf
for i = 1:m
 ah = subplot(m,1,i);
 plot(rnge,d(:,i))
 if i == 1 title('My title') endif
 grid,ylabel(sprintf('Series %d',i));
 if i == m axis("tic","label") else axis("ticy","labely") endif
 pos = get(ah,'position') .* [1 1 1.2 2.5] + [-0.075 -0.05 0 0];
 set(ah, 'position', pos);
endfor

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(gate 20, 1st floor, room C71)         Web:    http://fly.isti.cnr.it



reply via email to

[Prev in Thread] Current Thread [Next in Thread]