3
$\begingroup$

If a type Style[x^2 + y^2 <= 9, Red, 20] I get:

enter image description here

But if I include that in a plot or graphic, mathematic function appear as:

enter image description here

How can I get the mathematic formula in previous style?

$\endgroup$
3
$\begingroup$

You need to override the default FontFamily used in Graphics:

Graphics[
 Text[Style[x^2 + y^2 <= 9, Red, 20, FontFamily -> "Times"]]
 ]
$\endgroup$
3
$\begingroup$

You can set an option so that all Text objects in graphics are displayed in "Times" for the duration of the front end session, so that one doesn't have to repeatedly add the FontFamily directive to every graphic:

SetOptions[
    $FrontEndSession,
    InsetBoxOptions->{DefaultBaseStyle->{FontFamily->"Times"}}
]

For example:

Graphics[{Text[x^2+y^2==1]}, PlotLabel->BesselJ[n,x], ImageSize->100]

enter image description here

If you want to make this permanent, then replace $FrontEndSession with $FrontEnd. An alternative is to modify the "Graphics" style in the stylesheet.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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