using export_fig to crop image, including axis

Hi all,
I am trying to use export_fig to crop the image. I successfully removed the background, but the numbers for the axis are still on display.
This is the code:
figure(1)
imagesc(x_axis,axial_distance_water,grayscale2);
colormap(gray);
axis image
export_fig(filename,'-transparent','-tif');
I attach the resulting figure using export_fig and what I need (using cropping function with PowerPoint).
Did anybody had the same issue?
I could not find related examples shown in github for export_fig.
Thanks in advance

4 件のコメント

jonas
jonas 2018 年 8 月 16 日
Why dont you just remove the ticklabels?
ARP
ARP 2018 年 8 月 16 日
you are right, that does the job.
Thanks!
ARP
ARP 2018 年 8 月 16 日
respond as an answer instead of commenting, otherwise I can't accept your answer
jonas
jonas 2018 年 8 月 16 日
Will do.

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

 採用された回答

jonas
jonas 2018 年 8 月 16 日

0 投票

Consider removing the ticklabels and/or ticks before exporting the figure.
set(gca,'ytick',[],'xtick',[])
set(gca,'yticklabels',{},'xticklabels',{})

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

質問済み:

ARP
2018 年 8 月 16 日

回答済み:

2018 年 8 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by