Message Boards Message Boards

0
|
1098 Views
|
4 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Tooltips disappear while using PlotHighlighting

Posted 5 months ago

If I use the PlotHighlighting option in a plot, I lose the ability to see Tooltips. Is the Tooltip function incompatible with the new functionality?

Try this code (with and without PlotHighlighting):

ListLinePlot[
 Tooltip[#, #] & /@ Table[{x, 2 Sin[x] + x + 0.}, {x, 0, 50, 1}], 
 PlotHighlighting -> "Crosshairs"]
POSTED BY: John McCallon
4 Replies
Posted 5 months ago

I don't know the official answer, but it seems like they might be incompatible, yes. However, you can recover the behavior by adding another highlighting option:

ListLinePlot[Table[{x, 2 Sin[x] + x + 0.}, {x, 0, 50, 1}], PlotHighlighting -> {"Crosshairs", "XYLabel"}]
POSTED BY: Eric Rimbey
Posted 5 months ago

Yes, that is a workaround. I do find the ability to custom format the label with Tooltip very helpful especially with dates on the x-axis (the system defaults can be too granular).

Hopefully, the PlotHighlighting options will be improved in the next release.

POSTED BY: John McCallon

Usually having PlotHighlighting and Tooltips at the same time is frustrating since they're both reacting to the mouse, trying to put their popups in the same place, etc...

As a result, PlotHighlighting -> Automatic turns off the highlighting if there are tooltips, callouts, etc...

Giving a specific setting for PlotHighlighting will turn it on.

POSTED BY: Brett Champion
Posted 5 months ago

Is there any way to have a custom label generator? This seems to sometimes work better, but can be temperamental.

ListLinePlot[Table[{x, 2 Sin[x] + x}, {x, 0, 50, 1}], 
 LabelingFunction -> (Placed[#1[[1]], Tooltip] &), 
 PlotHighlighting -> "Crosshairs"]
ListLinePlot[Table[{x, 2 Sin[x] + x}, {x, 0, 50, 1}], Mesh -> All, 
 LabelingFunction -> (Placed[#1[[1]], Tooltip] &), 
 PlotHighlighting -> "XYDroplines"]
POSTED BY: John McCallon
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract