5
$\begingroup$

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.)

$\endgroup$
  • $\begingroup$ same issue in version 9.0 MS Windows (64-bit) $\endgroup$ – kglr Dec 19 '17 at 23:21
  • 3
    $\begingroup$ Does basestyle/cachegraphics/false for plot help? - sent from Nokia 3310 $\endgroup$ – Kuba Dec 19 '17 at 23:23
  • 1
    $\begingroup$ @Kuba Yes, BaseStyle -> {"CacheGraphics" -> False} solved the problem. You can post the answer and I'll accept it. $\endgroup$ – Alexey Popkov Dec 19 '17 at 23:25
  • $\begingroup$ @AlexeyPopkov ok, done, please report it anyway. $\endgroup$ – Kuba Dec 20 '17 at 9:15
  • 1
    $\begingroup$ @Kuba Reported to the support as [CASE:3984748]: "<...> I was able to reproduce the behavior you described and will forward this to our development team. <...>" $\endgroup$ – Alexey Popkov Dec 29 '17 at 1:34
3
$\begingroup$

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:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.