How do I remove the bottom line of the axes in a saved figure?
45 ビュー (過去 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:
その他の回答 (1 件)
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.