How can i modify the values on the y axis ?
Mostrar comentarios más antiguos
Hello everyone!
I was wondering if it were possible to modify the numbers on the y axis, while maintaining the plot as it already is.
For example here :

Is it possible at the 200 mark on the y axis to reset it to 0, 225 to 25, 275 to 50 etc... And the same for 400 (set it at 0) ?
3 comentarios
Mathieu NOE
el 19 de Jul. de 2021
Why not making separate subplots with tight axis ?
dpb
el 19 de Jul. de 2021
Yeah, I looked too quickly at the plot -- he's got multiple plots.
tiledlayout is the current preferred for subplot although I don't think one can get zero spacing as is shown. Probably stackedplot is closest builtin solution.
Anas Abid
el 21 de Jul. de 2021
Respuestas (1)
You can label the ticks however you wish --
yticklabels(yticks-200);
However, that doesn't change the data of course so the datatip cursor will still show the actual data values.
You would have to plot(x,y-200) to do that easily; otherwise I presume there's a way one could manage to write a callback function but I've not explored that aspect.
ADDENDUM:
Above changes them all, overlooked the details of the plot, sorry.
I think stackedplot is probably the built in solution that comes closest to wished-for look.
3 comentarios
Anas Abid
el 21 de Jul. de 2021
Mathieu NOE
el 22 de Jul. de 2021
Mathieu NOE
el 22 de Jul. de 2021
and this one too :
Categorías
Más información sobre Subplots 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!