MATLAB Answers

using export_fig to crop image, including axis

1 view (last 30 days)
ARP
ARP on 16 Aug 2018
Answered: jonas on 16 Aug 2018
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 Comments

Show 1 older comment
ARP
ARP on 16 Aug 2018
you are right, that does the job.
Thanks!
ARP
ARP on 16 Aug 2018
respond as an answer instead of commenting, otherwise I can't accept your answer

Sign in to comment.

Accepted Answer

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

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by