Datatips does not work with rectangle
조회 수: 6 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
Dyuman Joshi
2023년 8월 28일
편집: Dyuman Joshi
2023년 8월 28일
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
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!