Force certain data tips to show by default on figure?
6 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
Srijith Kasaragod
2021 年 9 月 20 日
編集済み: Srijith Kasaragod
2021 年 9 月 20 日
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)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Visual Exploration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!