very narrow imagesc subplots

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

very narrow imagesc subplots

DD854
In the following simple example code, the (sub)plots are coming out much
too narrow in width (x-direction) by default; they are unreadable.  The
default amount of whitespace is truly excessive. When I attempt to widen
the 3rd subplot by a factor beta, I get unexpected results.  I am
expecting the 3rd subplot to remain in position and to simply widen in
the x-direction, but instead the subplot seems to move around and stay
narrow.  This suggests the origin of the subplot is far away, but why
would the subplot stay narrow?  If someone would please run this brief
example code, play with the value of beta, and explain what is
happening, I would be grateful.  What is a simple way to make these
subplots wider?

This code is based on the first web link in the initial comments.  I did
try "tightfig.m" and "tight_subplot.m" from the Matlab File Exchange on
some different code than below (but still imagesc in subplots), and
experienced similar frustration.

Using octave 3.8.1 in Ubuntu 14.04.




%http://stackoverflow.com/questions/16064451/reposition-colorbar-or-subplots
%https://www.gnu.org/software/octave/doc/interpreter/Axes-Properties.html
%http://blogs.mathworks.com/pick/2012/12/21/figure-margins-subplot-spacings-and-more/

clear;
close all;

figure(10)
ax(1) = subplot(1,3,1);imagesc(rand(100,1),[0 1]);
ax(2) = subplot(1,3,2);imagesc(rand(100,1),[0 1]);
ax(3) = subplot(1,3,3);imagesc(rand(100,1),[0 1]);

figure(20)
ax2(1) = subplot(1,3,1);imagesc(rand(100,1),[0 1]);
ax2(2) = subplot(1,3,2);imagesc(rand(100,1),[0 1]);
ax2(3) = subplot(1,3,3);imagesc(rand(100,1),[0 1]);

% Get positions of all the subplot
posa = get(ax,'position');
posa2 = get(ax2,'position');
%h    = colorbar;

%attempt to make the 3rd subplot wider in figure 20.  why does this fail???
m=3;
beta=3.0;
posa2{3}(m)=posa2{3}(m)*beta;

set(ax2(3),'position',posa2{3})

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