Datatips does not work with rectangle

1 visualización (últimos 30 días)
Dominik Coenen
Dominik Coenen el 28 de Ag. de 2023
Editada: Dyuman Joshi el 28 de Ag. de 2023
Hi there,
I am trying to highlight a specific area of my plots. I use a rectangle to do this. After drawing the rectangle, the datatips do not work in the area of the rectangle.
My Code:
plot(filtered_CN0.Var1,filtered_CN0.Var9,'DisplayName',string(unique_satID(j)));
rectangle('Position',[epvt_csv_table.tow(areaStarts(i)), 0, epvt_csv_table.tow(areaEnds(i)) - epvt_csv_table.tow(areaStarts(i)), 50],'FaceColor', [0.6350 0.0780 0.1840 0.2]')
Also, plotting the rectangle first and then plotting the data does not work. Is there a better way to solve this problem?
Thanks for your help.

Respuesta aceptada

Dyuman Joshi
Dyuman Joshi el 28 de Ag. de 2023
Editada: Dyuman Joshi el 28 de Ag. de 2023
figure()
%Draw the rectangle first
rectangle('Position',[3 3 3 3],'FaceColor',[1 0 0]);
%hold on - to add the plot to the same figure on top of the rectangle
hold on
%Then plot the curve
plot(1:10); % Plots the line

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by