Filter löschen
Filter löschen

Make the data tip ignore superimposed plot data

10 Ansichten (letzte 30 Tage)
Matt J
Matt J am 1 Feb. 2013
Kommentiert: Matt J am 31 Dez. 2022
I have a code routine that displays an image in a figure window and also superimposes a scatter plot onto that image. When the data tip tool is clicked on a pixel too close to one of the plot points (even not directly on it) the data tip will try to process a nearby plot point instead of the image pixel directly under it. Zooming does not help.
Is there a way that I can make the data tip ignore the presence of the plot data?

Akzeptierte Antwort

Tom Lane
Tom Lane am 1 Feb. 2013
If h is a handle to the plot line, I'd expect set(h,'HitTest','off') to do what you want. Not 100% sure, but give it a try.
  4 Kommentare
Matt J
Matt J am 8 Feb. 2013
Thanks Sean. Actually, it appears you have to turn off the 'HitTest' both of the imellipse handle and the children hC. Otherwise, the interior of the ellipse will be opaque to the data tip and no pixels inside the ellipse can be probed.
Matt J
Matt J am 31 Dez. 2022
Unfortunately, the remedy doesn't appear to work for the new family of ROI handles like images.roi.ellipse. It has neither a HitTest, nor PickableParts property and neither do its children.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Johannes James
Johannes James am 11 Nov. 2022
In looking for an answer to this issue, I hit this old thread. Sorry to revive it, but the accepted answer didn't work for my case (R2022a) in which I had semitransparent polygon and area objects but needed datatips on the plots underneath. The accepted answer earlier got me looking in the right place, so thanks!
What did it for me was setting the 'PickableParts' property to 'none' for the occluding objects.
e.g. if lp is the polygon, making it not 'pickable' enabled me to drop datatips through it onto plots beneath.
lp = patch(x1,y1,'red','FaceAlpha', 0.3,'EdgeColor','none');
set(lp,'PickableParts','none');

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by