有没有一种方法可以只删除Matlab图形中的轴线,而不会影响刻度线和刻度线标签.
Is there a way to remove only the axis lines in the Matlab figure, without affecting ticks and tick labels.
我知道box可以切换上轴和右轴的线条和刻度,并且对我来说效果很好. 但是我的问题是我想消除底部和左侧线条(仅线条!),但保留刻度线和刻度线标签.
I know that box toggles the upper and right axes lines and ticks and that works perfectly for me. But my problem is that I want eliminate the bottom and left lines (only lines!) but keeping the ticks and tick labels.
有什么花招吗?
推荐答案有另一种未公开的记录方式(适用于MATLAB R2014b和更高版本),通过将标尺的'LineStyle'更改为'none'来删除行.
There is another undocumented way (applicable to MATLAB R2014b and later versions) of removing the lines by changing the 'LineStyle' of rulers to 'none'.
示例:
figure; plot(1:4,'o-'); %Plotting some data pause(0.1); %Just to make sure that the plot is made before the next step hAxes = gca; %Axis handle %Changing 'LineStyle' to 'none' hAxes.XRuler.Axle.LineStyle = 'none'; hAxes.YRuler.Axle.LineStyle = 'none'; %Default 'LineStyle': 'solid', Other possibilities: 'dashed', 'dotted', 'dashdot'
这与 Dan的答案不同,后者使用了'visible'属性尺子.
This is different from Dan's answer which uses the 'visible' property of rulers.
更多推荐
仅删除轴线而不会影响刻度线和刻度线标签
发布评论