Filter löschen
Filter löschen

Force certain data tips to show by default on figure?

5 Ansichten (letzte 30 Tage)
David Alston
David Alston am 29 Mär. 2021
Bearbeitet: Srijith Kasaragod am 20 Sep. 2021
I have some code that adds points to an existing figure one point at a time with custom data tips for each point:
s = scatter(postXY(1), postXY(2), markerSize, markerColor, markerType, 'LineWidth', markerLWidth);
s.DataTipTemplate.DataTipRows(end+1).Label = strcat('POST-', currFldr.connectorNames{N});
s.DataTipTemplate.DataTipRows(end+1).Label = strcat('BranchID-', num2str(currFldr.connectorIDs{N, 7}));
This works great for putting interactive custom data tips at these locations. However, I would really like the default functionality to be the opposite of what it is now. Right now the data tips are hidden by default and only show up when you hover/left click to pin them. Is there a way to show all these data tips by default, then have left clicking hide the data tip you clicked on?
There are some other data tips on this figure that I would like to keep hidden by default, so a method that just shows all data tips in the figure would not work.

Antworten (1)

Srijith Kasaragod
Srijith Kasaragod am 20 Sep. 2021
Bearbeitet: Srijith Kasaragod am 20 Sep. 2021
As per my understanding, you have a scatter plot and wish to have certain data tips visible in the plot by default. You could use 'datatip' function to implement the same. The following code shows an example:
x=0:10;
y=x;
s= scatter(x,y);
datatip(s,5,5); %function places a datatip at the point (5,5)

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by