Seting ticks on axis

3 ビュー (過去 30 日間)
Shani Gal
Shani Gal 2013 年 6 月 2 日
Hi
I have the following code:
A=linspace(-0.5,0.5)
B=linspace(-12.5,15)
plot(A,B)
axis([-0.5 0.5 -25 25])
set(gca,'XTick',[-0.5:0.25:0.25])
set(gca,'YTick',[-25:12.5:25])
My problem is that on the x-axis the last tick is missing: tick number 0.5 (I have -0.5 -0.25 0 0.25 )and I would like to have 0.5 at the end of the x-axis. ( y-axis is Ok)
Thanks
Shani

採用された回答

the cyclist
the cyclist 2013 年 6 月 2 日
I guess instead of this
set(gca,'XTick',[-0.5:0.25:0.25])
you actually wanted this
set(gca,'XTick',[-0.5:0.25:0.5])
?

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by