Setting axes in bar function
Mostrar comentarios más antiguos
Exemple
x=0:1:20
y=1;.9999999;.9999998;.9999997;.9999996;.9999996;.9999995;.9999994;.9999993;.9999992;.9999991;.9999991;.9999991;.9999991;.9999991;.9999991;.9999991;.9999991;.9999991;.9999990;.9999990]
bar(x,y)
-----------------------------------------------
The variation of my function is very small, and the values are very precise (1e-10)
I want to customize the way in which tick labels appear in Matlab plot axes
- 1/ modify the x and y axes limits (from min value to max value)
- 2/ display 10 decimal digits in y and x axes

Respuesta aceptada
Más respuestas (2)
use xlim, ylim options... you can simply give
xlim=([xmin xmax]);
ylim=([ymin ymax]);
or
set(gca,'XLim',[xmin xmax]);
set(gca,'XTick',[xmin:interval:xmax]);
set(gca,'YLim',[ymin ymax]);
set(gca,'YTick',[ymin:interval:ymax]);
for decimal places
xn=get(gca,'xtick');
set(gca,'xticklabel',sprintf('%.10f |',xn));
yn=get(gca,'ytick');
set(gca,'yticklabel',sprintf('%.10f |',yn));
abidi Mohamed
el 1 de Jun. de 2014
0 votos
3 comentarios
aneps
el 2 de Jun. de 2014
see the update of my answer....
Star Strider
el 2 de Jun. de 2014
...posted 21 hours after mine...
abidi Mohamed
el 2 de Jun. de 2014
Editada: abidi Mohamed
el 2 de Jun. de 2014
Categorías
Más información sobre Grid Lines, Tick Values, and Labels en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

