仅删除轴线而不会影响刻度线和刻度线标签

编程入门 行业动态 更新时间:2024-10-28 14:30:29
本文介绍了仅删除轴线而不会影响刻度线和刻度线标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有一种方法可以只删除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.

更多推荐

仅删除轴线而不会影响刻度线和刻度线标签

本文发布于:2023-07-18 08:32:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1142874.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:刻度   轴线   标签

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!