How to plot some xtickslabel that correspond to y data?
2 views (last 30 days)
Show older comments
Hello!
I've read a lot of answers about xticklabel and datetick, but i'm very confusing yet.
I have two vectors of 30 points.
y = 30 points
x = 30 points type date string (i've used datestr() from a datenum() number) (HH:MM:SS.FFF). See like this:
' 06:22:19.041'
' 06:22:19.048'
' 06:22:19.050'
' 06:22:19.055' ...
I used the plot function only for the y data:
plot(y);
The x data on the graphic was = 1...5...10...15...20...25...30. (7 numbers!)
So, i changed the xtickslabels:
set(gca, 'XTickLabel', x);
And the xtickslabels changed for the only the first 7 numbers of my x vector.
I need plot few points, as i did, but the points on xticks have to correspond to the y data.
Thanks. Sorry about the language
0 Comments
Answers (1)
See Also
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!