How do I plot data points with x-axis tick labels that are strings?
Show older comments
hello there, i have 15 (x) points named x1 to x15; and corresponding to this i have 15 (y) points named from y1 to y15. how can i plot them ?
4 Comments
James Tursa
on 18 Sep 2017
Don't create variable names like this in the first place. As you can tell, it becomes hard to work with them downstream in your code. Instead, rewrite your code to produce a single variable named x that has all of the 'x' values, and another variable called y for the 'y' values. Then it is simple:
plot(x,y);
MAHMOUD ALZIOUD
on 18 Sep 2017
Marylyn Sammut
on 14 Jan 2022
how can you do it with plot(data, ‘.’, (signalNoise,signalTime)
Walter Roberson
on 15 Jan 2022
Edited: Walter Roberson
on 24 Jan 2022
I have the suspicion that you might be attempting to plot variables in a table() object. No currently released version of MATLAB supports that directly; you would need to instead
plot(data.signalTime, data.signalNoise, '.')
Accepted Answer
More Answers (1)
ejjada
on 16 Mar 2024
0 votes
plz anyone answer me
how to read my hole x axis data as x1,x2,x3,x4,...
1 Comment
Walter Roberson
on 16 Mar 2024
Please read http://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically-eval for information about why we strongly recommend against creating variable names dynamically.
Categories
Find more on Grid Lines, Tick Values, and Labels 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!