figure%plotting the contourcontourf(x*2.54,y*2.54,pdata(j).k,64,'linecolor','none')%setting color rangecolormap('jet')%allowing colorbar to be manipulatedcbar = colorbar('peer', gca);%setting colorbar labelcbar.Label.String = 'Mach Number';%setting axii labelsxlabel('r [cm]')ylabel('r [cm]')%putting a scatter plot onto the contourhold onset(gca,'FontSize', fontsize);scatter(xxxx2*2.54,yyyy2*2.54,,'k')st_fig_range = caxis;%setting colorbar rangescaxis([st_fig_range(1) st_fig_range(1)+1]);cbar.XTick=[round(st_fig_range(1),2):0.1:round(st_fig_range(1),2)+1];end%attempting to make axis squareaxis square%saving figureprint(gcf,[figpath,Reynoldsrange,...sprintf('/ContourM%.0fz%.0f', machnumber,j) ],'-depsc','-loose')
So here is my code, hopefully these comments make sense. This is embedded in some research code I have been working on for several years so it may not be the cleanest, but it generally works really well. I am by no means an expert in Matlab, but I am happy with the codes efficiency (or lack there of). Mostly, the 'axis square' command isnt working.
Due to the colorbar, the axis arent completely square. The plot is slightly taller than it is long. I need to automate this because of how many figures I am producing. Is there a method, brute force or otherwise, that would make this work?
I would love some help! Thanks!