How to show two axis on a plot only where i want them
Mostrar comentarios más antiguos
Hi Matlab Gurus,
I have the plot below, and i have two y axis, one on the left and one on the right, which are different to each other.
What i would like to do is only show the numbers on the y-axis (left and right), where the horizontal lines are
So i can draw a horizontal line using the left axix, and i can draw another horizonal line using the right axis.
then i want the axis to only show exactly where those lines are, not evenly spread based on itself, but only where the lines are, so that i know the exact value of the lines at both the left and right axis.
Any help would be highly appreciated.

Respuesta aceptada
Más respuestas (1)
try this yticks
h = plot(0:10,sin(0:10));
yy = 0:0.2:1;
[x,y] = ndgrid([0 10],yy);
line(x,y)
yticks(yy)
1 comentario
Rizwan Khan
el 10 de Jun. de 2021
Categorías
Más información sobre Annotations 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!



