How do I remove the bottom line of the axes in a saved figure?
조회 수: 17(최근 30일)
I drew a graph and deleted axes by using the code below.
hAxes = gca;
hAxes.XRuler.Axle.LineStyle = 'none';
However, when I added lines by using 'line' commend to explain each components, the axis at the bottom appeared again as shown below.
I don't know why axis appeared again. Anyway, I drew white lines to hide black axis as shown below.
OK. It looks good to me. However, when I saved the graph as a pdf image, the axes appeared again!
pos = get(gcf,'Position');
Please somebody save me~!!!!
Abby Skofield 2018년 10월 16일
편집: MathWorks Support Team 2018년 11월 28일
If you do not want the axes outline to appear, you can turn it off using this command:
If you have an area, bar, or stem plot that has a baseline and want to turn off the baseline, set the Visible property of the Baseline object to 'off', for example:
a = area(magic(5));
a(1).BaseLine.Visible = 'off';
If those approaches do not resolve the problem, you can try preserving the plot colors when printing or saving by setting the InvertHardcopy property of the Figure object to 'off' before printing, for example:
Akira Agata 2017년 10월 10일
By setting the 'Visible' property of the axes 'off' after plotting your graph, you can remove the axes. Following is a simple example.
% Plotting your graph, like:
% Set the 'visible' property 'off'
ax = gca
ax.Visible = 'off'
% The axes is removed from PDF file, too.