フィルターのクリア

Limiting the extent of the crop using export_fig

2 ビュー (過去 30 日間)
Leo Simon
Leo Simon 2016 年 12 月 31 日
編集済み: Leo Simon 2017 年 1 月 1 日
I'm using export_fig with the following command (both options are necessary for me):
export_fig('png','opengl',<filename>)
The program is great but it crops the figure so that the boundary of the png file touches the title and labels text, as the example illustrates. Is there a way to modify the crop so that it leaves a little bit of space around the title and the labels? Thanks.

採用された回答

Matt J
Matt J 2016 年 12 月 31 日
編集済み: Matt J 2016 年 12 月 31 日
I thought export_fig had a -p switch to let you specify padding. If not, a workaround might be to use multi-line plot titles and labels to pad your labels with blank extra lines, e.g.,
xlabel({'Label Text',' ',' ',' '})
  1 件のコメント
Leo Simon
Leo Simon 2017 年 1 月 1 日
編集済み: Leo Simon 2017 年 1 月 1 日
Thanks for the suggestions, Matt! Export_fig does indeed have a padding option, but it didn't work in the version I was using. I've updated the software and it looks as though it's fixed in the new one.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 12 月 31 日
You might have to read it in as an image, then use padarray() or regular assignment to pad the edges. Then save it back out. Unless export_fig() has such a padding option already.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by