How to let y-axis ticks increase by 2?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
AbelM Kusemererwa
el 23 de Jul. de 2015
Respondida: Azzi Abdelmalek
el 23 de Jul. de 2015
How to let y-axis ticks increase by 2? The number on the y-axis should also be in 2 decimal places. What codes will I use?
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 23 de Jul. de 2015
Look at this
t=0:0.001:10;
y=12.5*sin(t)
plot(t,y)
yt=get(gca,'ylim')
nyt=yt(1):2:yt(2)
ytl=cellfun(@(x) sprintf('%.2f',x),num2cell(nyt),'un',0)
set(gca,'ytick',nyt,'yticklabel',ytl)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!