Mathematica Asked by rogerl on August 11, 2021
I’m trying to annotate a plot with points of the form $left(frac{1}{2},frac{1}{2}right)$; my problem is that the parentheses don’t stretch to cover the fraction. I think that what I want to do is to use a StyleBox
inside the Graphics
primitive to allow me to format the string using SpanMaxSize
, but StyleBox
is not a text string. I cannot figure out how to make this work. Is there an easier way?
So for example, if I use
Graphics[Text[Style["(1/2,sqrt(3)/2)", Black, 12], {-1.1, .8}]]
In graphics, Text
objects render in TraditionalForm
. In TraditionalForm
, parentheses are used instead of square brackets. So you can achieve what you want by using an expression with an invisible head:
Graphics[Text[Style[Invisible[""][1/2,Sqrt[3]/2],Black,12],{-1.1,.8}]]
There are other ways to achieve this behavior, but they require learning a bit about how boxes work.
Correct answer by Carl Woll on August 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP