필터 지우기
필터 지우기

Colorbar font size decreases upon export

조회 수: 18 (최근 30일)
Daniel
Daniel 2021년 3월 12일
댓글: Daniel 2021년 3월 15일
When I export my contours with colorbar labels, the font size is being decreased. Take, for example:
testx = 1:10; testy = 1:10; testc = [1:10].*ones(10,10);
figure,contourf(testx,testy,testc)
c = colorbar; c.Label.String = 'string'; c.Label.FontSize = 14;
Make this figure, go to File > Export setup > Export (I'm exporting to .eps) and the colorbar label will shrink. I have found other answer that would let me maintain a minimum size for ALL text, but I'd like the tick labels to remain small. Is there a way to prevent this?

채택된 답변

ANKUR KUMAR
ANKUR KUMAR 2021년 3월 13일
편집: Image Analyst 2021년 3월 15일
Instead of manually saving the figure, you can prefer to save figure by command. It won't shrink the figure.
print('sample','-deps','-r200')
Refer to this for reference.
  댓글 수: 4
Daniel
Daniel 2021년 3월 15일
See attached. export.PNG is the result when using export from the File menu in the figure. Notice the small font size on the colorbar label. It had was bigger before exporting. print.PNG is the result from trying your method above. Notice that there is no padding around the outermost features of the figure.
Daniel
Daniel 2021년 3월 15일
Update: I tried the print method on some other plots and they maintain some white space around the edges. Perhaps it has something to do with my legend placement? That's the main difference I see.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2021년 3월 15일
Have you tried exportgraphics(), if youre using r2020a or later? Or try using saveas().
  댓글 수: 1
Daniel
Daniel 2021년 3월 15일
exportgraphics worked well, though I don't have access to r2020a for all my codes.

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

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by