plot tools tick mark pi

17 ビュー (過去 30 日間)
nathaniel sokolow
nathaniel sokolow 2016 年 6 月 8 日
回答済み: Jos (10584) 2016 年 6 月 8 日
How can I write pi in a tick mark using plot tools? it says tick marks must be numeric when I try.

回答 (1 件)

Jos (10584)
Jos (10584) 2016 年 6 月 8 日
t = linspace(0,2*pi,100) ;
y = sin(t) ;
plot(t,y,'bo-') ;
set(gca,'xtick',[0:pi:2*pi]) % where to set the tick marks
set(gca,'xticklabels',{'0','\pi','2\pi'}) % give them user-defined labels

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by