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

查看:35
本文介绍了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天全站免登陆