plot tools tick mark pi

7 visualizaciones (últimos 30 días)
nathaniel sokolow
nathaniel sokolow el 8 de Jun. de 2016
Respondida: Jos (10584) el 8 de Jun. de 2016
How can I write pi in a tick mark using plot tools? it says tick marks must be numeric when I try.

Respuestas (1)

Jos (10584)
Jos (10584) el 8 de Jun. de 2016
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

Categorías

Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by