Plotting/Scatter of m-by-n matrix versus time
13 views (last 30 days)
Show older comments
Hello all,
I have a set of data that is binned into 12 timestamps. That is to say, a matrix of 154x12, that I would like to (and have) plotted over my 12 timestamps. Currently I'm simply using the 'o' markers and omitting lines between points to "mimic" a scatter plot. Scatter returns an error, as it wants my data to be 1x12. I could use a loop, but this data set will continue to grow larger and it will be cumbersome. Wondering if there may be another way to present this data as I have, but with the scatter command or something similar.
At the end of the day, I want to use "hold on" and plot to distinct (but identical in size) data sets with each other on the same plot with different colors, which I've done, but the nature of the plot command doesn't allow me to label them in the legend easily - it treats each m rows of the n data points as a separate legend object. The below link is the only other community question I've seen posted similar to this topic.
Thanks all!
0 Comments
Answers (1)
Sulaymon Eshkabilov
on 18 Jun 2021
It should work if you write your code, e.g.:
t=1:12;
G = randi([0, 13], 154, 12);
plot(t, G, 'o--'), shg
0 Comments
See Also
Categories
Find more on Scatter Plots 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!