special data tip in matlab

2 visualizzazioni (ultimi 30 giorni)
fima v
fima v il 17 Nov 2022
Hello i have a figure with multiple plots i want to make a data tip line as shown bellow.
so the points of intersectionof the red line with the plots will be the location of the data tips
and such data tip say what legent the red line crossed and the X,Y values of the intersection point?
is it possible ? because if we have 40 plots the 40 colors they all look the same . such "red line" could help see the legend of the plot so we want be confused
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 100*exp(-0.5*x).*sin(10*x);
figure;
hold on
plot(x,y1)
plot(x,y2)
hold off
legend('data1','data2')

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by