フィルターのクリア

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 Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by