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.

The FrameStyle option in Framed seems to work for some graphics directives but not others, eg:

Framed["yo", FrameStyle -> Blue]

enter image description here

But

Framed["??", FrameStyle -> Thickness[0.1]]

and

Framed["??", FrameStyle -> Directive[Thickness[0.1]]]

seem to have no effect (having varied thickness parameter)

enter image description here

share|improve this question
    
I can only confirm that this happens on my PC (Win7-64/MMA8.04) too. The documentation suggests that the above should be possible, though not a single example using Framed, FrameStyle and Thickness together is given. –  Sjoerd C. de Vries Jul 31 '12 at 21:43
add comment

1 Answer

up vote 12 down vote accepted

It indeed seems that the thickness of the frame doesn't respond to any of the options in Frame. As a workaround, you could do this:

SetOptions[FrameBox, BoxFrame -> 3]; 
Framed["AA", FrameStyle -> Red]

However, the SetOptions will affect all frames drawn in your notebook (even ones that have been drawn before).

A more customizable approach would be to use the lower level FrameBox directly. This is shown here - using the ability of BoxFrame to specify thicknesses of all sides individually:

FrameBox["AA", FrameStyle -> Red, 
  BoxFrame -> {{1, 4}, {1, 1}}] // DisplayForm

framed

share|improve this answer
    
+1 Nice little insights ;-) –  Vitaliy Kaurov Jul 31 '12 at 22:47
2  
BoxFrame can be used directly with Framed, so use of lower level boxes can be avoided: Framed["AA", BoxFrame -> {{1, 4}, {1, 1}}, FrameStyle -> Red] –  Mike Honeychurch Jul 31 '12 at 23:32
    
@MikeHoneychurch Thanks - but I get the red syntax error highlighting, even though it does indeed produce the desired result. I personally would prefer to avoid the red highlighting because it's distracting. –  Jens Aug 1 '12 at 1:33
3  
I've found this sort of syntax highlighting occasionally when doing things that work but are not documented. If it is distracting you can always change the colour. ;) –  Mike Honeychurch Aug 1 '12 at 1:40
add comment

Your Answer

 
discard

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

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