Clear Filters
Clear Filters

Add data class as additional information on 2D plot

1 view (last 30 days)
I have a data vector of N data points and another data vector of the same length. I'm drawing the plot of the first vector and adding vertical lines on some points, but I also want to add class labels from the second vector to each (or some) points of the first vector somehow.
The second vector contains just numerical labels from 1 to 3.
Currently, plot is called like that:
xline(border_frames, LineWidth=1, Color='red');
The second vector is
Plot looks like that:
What I want to achieve in any way possible:
I've stumbled upon datatip function but it doesn't work with my type of plot.

Accepted Answer

Dyuman Joshi
Dyuman Joshi on 20 Mar 2023
Moved: Matt J on 20 Mar 2023
text might be helpful

More Answers (0)


Find more on 2-D and 3-D 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!