Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Such details are driving me crazy while creating GUIs with Mathematica:

Panel[
  Panel["", Background -> Yellow, ImageMargins -> 0, ImageSize -> {26, 26}]
  , Background -> Black, Alignment -> Center]

enter image description here

Margins above are symmetric in vertical and horizontal direction, let's say I want to take control and specify FrameMargins:

Panel[
  Panel["", Background -> Yellow, ImageMargins -> 0, ImageSize -> {26, 26}]
  , Background -> Black, Alignment -> Center, FrameMargins -> {{1, 1}, {1, 1}}]

enter image description here

Now clearly they are not. I used 1 because then it is easily seen but the value does not matter.

Am I missing something?

Edit

With Framed it seems to be ok, but one have to add FrameStyle->None.

share|improve this question
1  
On OS X, v 9.0.0.0 both examples are symmetric. Perhaps it is a bug with OS/MMA version that you're using. –  Pickett Jan 13 at 9:25
2  
it works ok on windows 7, V 9.01, screen shot: !Mathematica graphics –  Nasser Jan 13 at 9:42
1  
I can reproduce this on Windows 2003. Very strange for this to be OS version-dependent. Same result in versions 8.0.4 and 7.0.1, albeit the asymmetry is less pronounced in the latter (the top margin is slightly thicker). –  Oleksandr R. Jan 13 at 10:51
1  
I saw no problem with the FrameMargins version, when I evaluated it in V.9.0.1 on OS X 10.6.8 –  m_goldberg Jan 13 at 14:24
1  
On Windows 7 x64 in MMa 8.0.4 both examples are symmetric. –  Alexey Popkov Jan 13 at 15:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.