Contour plot size reduction

조회 수: 7 (최근 30일)
Turbulence Analysis
Turbulence Analysis 2020년 10월 16일
댓글: Turbulence Analysis 2020년 10월 16일
Hi,
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
Ameer Hamza 2020년 10월 16일
편집: Ameer Hamza 2020년 10월 16일
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);
  댓글 수: 7
Ameer Hamza
Ameer Hamza 2020년 10월 16일
Yes, If it works for you, then it is fine. However, saveas() usually saves low-resolution files. print() and export_fig() are recommended for a high-resolution images.
Turbulence Analysis
Turbulence Analysis 2020년 10월 16일
Yes, you are correct. usually print yields highre resolution images.
One more query, how to write overbar in the axis title ??

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

KSSV
KSSV 2020년 10월 16일
Use this: https://in.mathworks.com/matlabcentral/fileexchange/23629-export_fig for exporting images for better quiality.

Bjorn Gustavsson
Bjorn Gustavsson 2020년 10월 16일
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.
HTH

카테고리

Help CenterFile Exchange에서 Purple에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by