2
$\begingroup$

How is it possible to insert Text inside Framed as below?

Graphics[{Circle[{0, 0}], Text[Style["cross-section", 14]]}]

enter image description here

Framed["cross-section", RoundingRadius -> 5]

enter image description here

That is, I want the Text inside Graphics to be "framed".

$\endgroup$
  • 1
    $\begingroup$ I don't understand, haven't you tried? Text[Framed@Style["cross-section", 14]] works well... $\endgroup$ – Kuba Nov 4 '15 at 9:50
  • $\begingroup$ Actually you can use pretty much anything in Text. It seems to be very very similar, near-identical, to Inset. But they do take different arguments. $\endgroup$ – Szabolcs Nov 4 '15 at 9:52
  • $\begingroup$ @Kuba: I don't know why I didn't try this combination. Actually the graphic I wanted to create was more complicated and somehow I was lost:-)! I was sure it is rather trivial. In any case, thanks a lot. Graphics[{Circle[{0, 0}], Text[Framed[Style["cross-section", 14], RoundingRadius -> 5], {0, 0.5}]}] does exactly what I wanted. $\endgroup$ – Dimitris Nov 4 '15 at 9:56
  • $\begingroup$ @Szalbocs: Thanks for the advice. $\endgroup$ – Dimitris Nov 4 '15 at 9:57
1
$\begingroup$
Graphics[{Circle[{0, 0}], 
  Inset @ Framed["cross-section", RoundingRadius -> 5]}]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks for the quick reply. $\endgroup$ – Dimitris Nov 4 '15 at 9:58
  • $\begingroup$ Anyway to not to use Inset. It's bit difficult to control relative sizes with Inset. $\endgroup$ – ablmf Feb 5 at 8:56

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