How can i set middle tick?

3 ビュー (過去 30 日間)
Gabriel Maia
Gabriel Maia 2018 年 8 月 17 日
編集済み: Gabriel Maia 2018 年 8 月 17 日
I want to set a graph with middle tics without number, like the picture. Also i need to enable sides ticks. How can i do it?

採用された回答

Adam Danz
Adam Danz 2018 年 8 月 17 日
編集済み: Adam Danz 2018 年 8 月 17 日
To turn on 'minor' ticks:
set(gca,'XMinorTick','on')
What's a side tick? Check out all the properties of ticks you can set:
  6 件のコメント
Gabriel Maia
Gabriel Maia 2018 年 8 月 17 日
編集済み: Gabriel Maia 2018 年 8 月 17 日
I got it now.
ax = gca;
ax.XAxis.MinorTick = 'on';
ax.XAxis.MinorTickValues = -7.5:1:7.5;
Adam Danz
Adam Danz 2018 年 8 月 17 日
I see the problem. You don't need to create another axis. You only need the axis handle of your current axis.
replace
hA = axes
with
hA = gca;
unless you already have your current axis handle available.
Also your minor ticks should be
-7.5 : 2 : 7.5

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by