I am trying to create a contour plot (with colorbar) which has the contour plot perfectly square, for aesthetic/data interpretation reasons.
Example code:
x=-10:10;
y=-10:10;
[X Y] = meshgrid(x,y);
f = figure('Visible','off');
contour(X,Y,X.*Y,'Fill','on');
colorbar
x_size = 10;
y_size = 10;
set(f, 'PaperUnits', 'inches','PaperPosition',[0 0 x_size y_size]);
print(f, '-depsc2','notsquare.eps);
Is there a way to control the dimensions of just the contour plot region such that it will be perfectly square?
This works for me (adding
axis equal):