Remove tick marks for axes

8 ビュー (過去 30 日間)
asd ad
asd ad 2020 年 8 月 7 日
コメント済み: asd ad 2020 年 8 月 7 日
Hello everyone,
I would like to remove just the tick marks on the top axis and the right axis. How do I do this? I have attached my plot code to this question.
Thanks
figure (2)
plot(RunNo,CAL,'o','Linewidth',2)
hold on
plot (VarName1,VarName2,'d','Linewidth',2)
xlabel ('Time (s)')
ylabel ('\theta (\circ)')
legend('Automated Measurements','Manual Measurements')
  2 件のコメント
Peng Li
Peng Li 2020 年 8 月 7 日
you can set Box property of the axes to 'off'. With this, the top and right axes will be gone completely. If you do like to have that box without ticks, I think you can fake this.
asd ad
asd ad 2020 年 8 月 7 日
But I need to have the box. Just need the tick marks removed

サインインしてコメントする。

採用された回答

J. Alex Lee
J. Alex Lee 2020 年 8 月 7 日
An easy way to "fake" this after setting "Box" to "off", as Peng Li suggests, is to make xline and yline. But it wouldn't be dynamic - if you change the axis limits, you'd have to re-draw the "fake" box
ylim = get(gca,'YLim')
xlim = get(gca,'XLim')
xline(xlim(2),'-k')
yline(ylim(2),'-k')
But just to comment, while a valid ask, it seems a very uncommon need...I don't think any editor or reader or consumer of plots would even notice/pay attention to such a detail, and if they noticed, I feel like at least 50% of the time (being generous with random chance) they would perceive it as odd rather than expected...
  1 件のコメント
asd ad
asd ad 2020 年 8 月 7 日
I think so too that it is a very uncommon need but my supervisor asked for it. I can't say no unfortunately

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by