Contour plot size reduction
13 views (last 30 days)
Turbulence Analysis on 16 Oct 2020
I plotting the contour with imagesc(), I am saving the final images in .fig and .bmp format. In the .bmp format some portion of the image is cropped, for e.g. colorbar legend got cropped. (please see the attachment). Do I need to reduce the image size.. ???
Ameer Hamza on 16 Oct 2020
Edited: Ameer Hamza on 16 Oct 2020
The problem is that the font size of axes labels is quite large, going beyond the figure limits. An easy fix is to change the size of the figure so that all the text is visible (preferrable maximize the figure window) and then run this line.
exportgraphics(gcf, 'file.png', 'Resolution', 300);
More Answers (2)
KSSV on 16 Oct 2020
Bjorn Gustavsson on 16 Oct 2020
To get the figures "just right" you might have to manually masage them a little bit. When it comes to colorbars I often have to resort to manually shift and resize them a little bit to get the numbers and labels inside the printed image-file. I do things like this:
cbh = colorbar;
dx = -0.02;
dWidthx = 0;
set(cbh,'Position',get(cbh,'Position')+[dx 0 dWidthx 0])
to shift the colorbar to the left. Sometimes I make it a bit narrower too, by setting dWidthx to a small negative number.