5

Bug introduced in 8 or earlier and fixed in 11.3
Reported to the support as [CASE:3984748]


Consider the following plot with a Button placed as PlotLabel:

ListLinePlot[Table[RandomReal[1, 1000], {i, 8}], PlotRange -> All, 
 PlotLabel -> Button["Press me!", Appearance -> None]]

screenshot

After clicking the button and moving the mouse out it gets blue background:

screenshot2

(Note that this doesn't happen if the number of plotted points is substantially reduced: e.g., replace 1000 with 100 in the code above and you won't see this.)

How can I avoid this? I wish to have the default appearance after releasing the button.

(Mathematica 11.2.0, Windows 7 x64.)

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368

1 Answers1

3

The fix is to add BaseStyle -> CacheGraphics -> False around:

ListLinePlot[
  Table[RandomReal[1, 1000], {i, 8}]
, PlotRange -> All
, PlotLabel -> Button["Press me!", Appearance -> None]
, BaseStyle -> CacheGraphics -> False
]

I would love to elaborate but this option is undocumented and the reason I knew it may be related is because I have faced similar issues:

Kuba
  • 136,707
  • 13
  • 279
  • 740