plot tools tick mark pi

조회 수: 7 (최근 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 CenterFile Exchange에서 Grid 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