|
From: | Ben Abbott |
Subject: | Re: changes to graphics.cc and subplot.m |
Date: | Fri, 19 Jul 2013 18:44:20 +0000 (GMT) |
I composed a simple test script to compare Matlab and Octave
clf ()
subplot (3,1,1)
plot (rand (3))
title ({'one', 'two', 'three'})
xlabel xlabel
subplot (3,1,2)
plot (rand (3))
xlabel xlabel
subplot (3,1,3)
xlabel xlabel
plot (rand (3))
xlabel xlabel
The results for Octave and Matlab are at the links below.
<http://octave.1599824.n4.nabble.com/file/n4655822/FLTK.png>
<http://octave.1599824.n4.nabble.com/file/n4655822/Matlab.png>
The results are consistent, but are also more esthetic than your example.
Can you provide a short script which I can run through Matlab to see how it
behaves?
In any event, I do think the margins between the subplots are too generous
and can be reduced.
For example, we could modify subplot.m subfunction -> subplot_position() and set margins.top = margins.bottom = margins.row. And perhaps also margins.left = margins.right = margins.column. Thus before calculating the subplot width and height we would ...
margins.top = min (margins.row, margins.top);
margins.bottom = min (margins.row, margins.bottom);
margins.right = min (margins.column, margins.right);
margins.left = min (margins.column, margins.left);
And then calculate the width and height.
width = 1 - margins.left - margins.right - (cols-1)*margins.column;
width = width / cols;
height = 1 - margins.top - margins.bottom - (rows-1)*margins.row;
height = height / rows;
To avoid problems with gnuplot, maybe this should only be done for non-gnuplot toolkits.
Ben
[Prev in Thread] | Current Thread | [Next in Thread] |