How to add yTickLabels to multi plot graph?
Ältere Kommentare anzeigen
Hello, please have a look at the attached pic. I have 25 plots, drawn on 1 figure (you can 25 raws...)
In the bottom-left corner, I've added with Paint, numbers (1,2,3,4,...).
Question is: how can I add this in Matlab without destroying my y Axis values? (what you can there as 50,100,150...)
Thanks
Akzeptierte Antwort
Weitere Antworten (1)
Steven Lord
am 18 Dez. 2016
0 Stimmen
Why not just add ticks at 1, 2, 3, 4, etc. in addition to those that already exist? Change the YTick property of the axes to do that.
3 Kommentare
Mark Golberg
am 18 Dez. 2016
Steven Lord
am 19 Dez. 2016
Nothing says that ticks must be equally spaced.
x = 1:10;
y = x.^2;
h = plot(x, y);
ax = ancestor(h, 'axes');
% Look at the ticks on the axes before running the next line
ax.YTick = y;
Nothing says that the tick labels must be the same as the tick values, either.
r = randperm(10) % Arbitrary values
labels = arrayfun(@num2str, r, 'UniformOutput', false);
ax.YTickLabel = labels;
Mark Golberg
am 19 Dez. 2016
Kategorien
Mehr zu Line Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!