1

Bug introduced in 6 and fixed in 7


Though my question my be related to this one, it doesn't look like it can easily be solved in the same way, so I hope not to be double-posting.

I am trying to insert a framed number/text into a graphics using Epilog. The text (black), the background (white) and the frame (coloured, e.g. orange) shall be of different colours.

As a minimal working example, the following code indeed produces the desired result:

Graphics[{
  LightGray, Disk[], 
  Inset[Framed[Style[ToString[text], Black, 50],
    Background -> Pink, 
    FrameStyle -> {Orange}]]}]

first example

Yet, when I try to change the background colour to White, it simply is ignored!

Graphics[{
  LightGray, Disk[], 
  Inset[Framed[Style[ToString[text], Black, 50],
    Background -> White, 
    FrameStyle -> {Orange}]]}]

second example

I know I could also apply the Background to the Inset rather than to the Framed, but that unfortunately results in the background colour slightly extending beyond the frame. I am using Mathematica version 6.

Any help on this would be greatly appreciated!

Bernd
  • 965
  • 9
  • 19
  • well it works in my case, I get a white background, using exactly your code (MMA 9.0.1) – Pinguin Dirk May 27 '13 at 08:35
  • Maybe I should add I am still on Mathematica 6. But simply adding a white background shouldn't really require state-of-the-art software, it seems to me... – Bernd May 27 '13 at 08:36
  • 2
    Seems to be a version problem. It works well for MMA 8.0.1 and 9.0.1. – partial81 May 27 '13 at 08:37
  • Well then I guess all I can hope for is some other user still on v6 who can figure a workaround. For know, the only easy solution that works for me is setting the colour to RGBColor[0.999, 0.999, 0.999], which turns out pretty white. – Bernd May 27 '13 at 08:40
  • What happens if you evaluate Graphics[{LightGray, Disk[], Text[Framed[Style["text", Black, 50], Background -> White, FrameStyle -> {Orange}]]}]? – m_goldberg May 27 '13 at 10:56
  • @m_goldberg Negative, unfortunately (still only works with non-white colours). – Bernd May 27 '13 at 11:33
  • What about an oh so slightly off-white gray value? – Yves Klett May 27 '13 at 13:54
  • @YvesKlett, that's what I ended up doing as a workaround, see my comment above on RGBColor[0.999, 0.999, 0.999]. – Bernd May 27 '13 at 14:13
  • ACK... sorry, I read over that :-) – Yves Klett May 27 '13 at 15:08
  • It also works in Mathematica 7, so I have tagged it as a bug in version 6. I hope you managed to update your version since asking this question. – Oleksandr R. Sep 27 '15 at 01:13

0 Answers0