Question

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
Was it helpful?

Solution

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

:)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top