1

The are entries suggesting the usage of export_fig package for exporting figures from MATLAB. However, when I use export_fig without any xlabel, the output figure has the x-tick labels trimmed from the bottom. With xlabel there are no problems. Am I doing something wrong here or have you also faced this problem?

I am attaching two figures and an example code.

Thanks,

bottom of the figure cropped

bottom of the figure not cropped

observeCropped = 1;
t = 0:.001:2;
f = @(t) sin(2*pi*t);
plot(t, f(t));
title('sin(t)');
if observeCropped
    export_fig sin1.pdf
else
    xlabel('time');
    export_fig sin2.pdf
end
dagcilibili
  • 461
  • 5
  • 11

1 Answers1

1

This is not a problem. It's work correct. If you want x-tick label without trimming try this code:

observeCropped = 1;
t = 0:.001:2;
f = sin(2*pi*t);
plot(t, f(t));
title('sin(t)');
xlabel('    ');
if observeCropped
    export_fig sin1.pdf
else
    export_fig sin2.pdf
end

:)

Plo_Koon
  • 2,953
  • 3
  • 34
  • 41
  • Oh I see. Well this adds maybe a bit too much space but can be removed by external tools, while trimming cannot be. – dagcilibili Nov 17 '13 at 14:25