how can I activate a data cursor on a matlab visualisation app

I did write matlab visualisation app what works perfectly.
Now I would like to use a Datacursor as shown in the standard Channel fields display.
what code do I have to add to my code of my visualisation app?

답변 (2개)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2019년 9월 23일

0 개 추천

datacursormode can be used to enable or disable data cursor mode.
For further information refer to the following link

댓글 수: 1

sorry - it does not help
in the chart are more than one curve and may be therefor the datacursor does not work.
What can be done?
The code:
%% Visualize Data %%
yyaxis left;
plot(time1, data1,'o-', time, dewPoint,'+-','LineWidth', 1.4)
datacursormode on
% Click mouse on surface to display data cursor
yl = ylim;
ylim([yl(1)-0.5 yl(2)+0.5]);
ylabel('Temperatures [°C]');
yyaxis right
plot(time2, data2,'o-','Color','g','LineWidth', 1.4);
yl = ylim;
ylim([yl(1)-1 yl(2)+1]);
ylabel('rel. Humidity [%]');
xlabel('Date');
title('rel.Humidity + Temp. / DewPoint');
legend({'Temp.Tu','DewPoint','Humidity'},'Location', 'best');
grid on

댓글을 달려면 로그인하십시오.

Melek Demir
Melek Demir 2020년 10월 8일

0 개 추천

%% Visualize Data %%
yyaxis left;
plot(time1, data1,'o-', time, dewPoint,'+-','LineWidth', 1.4)
datacursormode on
% Click mouse on surface to display data cursor
yl = ylim;
ylim([yl(1)-0.5 yl(2)+0.5]);
ylabel('Temperatures [°C]');
yyaxis right
plot(time2, data2,'o-','Color','g','LineWidth', 1.4);
yl = ylim;
ylim([yl(1)-1 yl(2)+1]);
ylabel('rel. Humidity [%]');
xlabel('Date');
title('rel.Humidity + Temp. / DewPoint');
legend({'Temp.Tu','DewPoint','Humidity'},'Location', 'best');
grid on

카테고리

도움말 센터File Exchange에서 Time Series Events에 대해 자세히 알아보기

제품

릴리스

R2019a

태그

질문:

2019년 9월 5일

답변:

2020년 10월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by