How to add yTickLabels to multi plot graph?
显示 更早的评论
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
采纳的回答
更多回答(1 个)
Steven Lord
2016-12-18
0 个投票
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 个评论
Mark Golberg
2016-12-18
Steven Lord
2016-12-19
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
2016-12-19
类别
在 帮助中心 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!