필터 지우기
필터 지우기

Saving images from figure window in Matlab.

조회 수: 1 (최근 30일)
Naseeb Gill
Naseeb Gill 2017년 7월 27일
댓글: Naseeb Gill 2017년 7월 28일
I'm saving images 500 dpi, using rendering in export setup from figure window in Matlab. But there is little change I have to make. I get image like below: I mean there is lot of white space at sides which I want to eliminate. White portion is marked with black sketch in image.
I want to make my image look like this: Whitout any white portion at sides.
How to do this?
Thanks.

채택된 답변

Chad Greene
Chad Greene 2017년 7월 27일
I recommend using export_fig, which crops the white space by default. The syntax is simply
export_fig myfig.png -r500
if you want 500 dpi. If you want a tiny bit of white space around the image, say, 1% of the figure width, do
export_fig myfig.png -r500 -p0.01
  댓글 수: 2
Naseeb Gill
Naseeb Gill 2017년 7월 27일
편집: Naseeb Gill 2017년 7월 27일
Thanks @Chad Greene for reply but when I proceed as you suggest I get following error:
Undefined function 'export_fig' for input arguments of type 'char'.
Error in boxplot_graph_draw (line 84)
export_fig myfig.png -r500 -p0.01 ;
The code I'm running is
// values of Rc, Gc etc. I loaded from laptop in workspace in form of //array
X = [Rc;Gc;Bc;Rs;Gs;Bs;Rl;Gl;Bl];
G = [zeros(length(Rc), 1); ones(length(Gc), 1); 2*ones(length(Bc), 1);3*ones(length(Rs), 1);...
4*ones(length(Gs), 1);5*ones(length(Bs), 1);6*ones(length(Rl), 1);7*ones(length(Gl), 1);...
8*ones(length(Bl), 1)];
boxplot(X,G,'Labels',{'Yc','Cbc','Crc','Ys','Cbs','Crs','Yl','Cbl','Crl'});
export_fig myfig.png -r500 -p0.01 ;
I added export_fig folder to maltlab path also.
Naseeb Gill
Naseeb Gill 2017년 7월 28일
Thanks @Chad Greene It works fine. Actually I made mistake in path addition. What I did was, I just select altmany-export_fig-5be2ca4 folder and click on save. But what I need to do is, I should open this folder using pathtool and then click on save.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by