matlab只删除顶部和右侧的刻度,并保留复选框 [英] matlab remove only top and right ticks with leaving box on

查看:577
本文介绍了matlab只删除顶部和右侧的刻度,并保留复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Matlab图中,我想在保持绘图框处于打开状态的情况下,仅从上轴和右轴删除刻度线.

In Matlab figure, I would like to remove ticks only from the top and right axes with keeping the plot box on.

我知道是否关闭绘图框,顶部和右侧的刻度消失了.但是,这不是我想要的.换句话说,我只想在底部和左侧保留刻度线,同时要保留绘图框.

I know if I make the plot box off, the ticks on the top and right go away. But, this is not what I want. In other words, I want to keep ticks only at the bottom and left and, at the same time, want to keep the plot box on.

推荐答案

我的解决方法类似于@j_kubik命题:

My workaround similar to @j_kubik proposition:

plot(1:10)
% get handle to current axes
a = gca;
% set box property to off and remove background color
set(a,'box','off','color','none')
% create new, empty axes with box but without ticks
b = axes('Position',get(a,'Position'),'box','on','xtick',[],'ytick',[]);
% set original axes as active
axes(a)
% link axes in case of zooming
linkaxes([a b])

这篇关于matlab只删除顶部和右侧的刻度,并保留复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆