3
$\begingroup$

Suppose we want to draw the following plot:

DensityPlot[ Sin[ x y], {x, -5, 5}, {y, -5, 5}, MaxRecursion -> 8,
PlotRange -> All, 
ColorFunction -> (Hue[Rescale[#, {0, 1}, {.7, 0}]] &), 
FrameLabel -> {Style["\!\(\*SubscriptBox[\(x\), \(g\)]\)", 
FontSlant -> Italic, FontSize -> 24], 
Style["\!\(\*SubscriptBox[\(p\), \(g\)]\)", FontSlant -> Italic, 
FontSize -> 24]}, 
LabelStyle -> {Bold, Black, FontSize -> 16, FontFamily -> Times}, 
Frame ->  True, FrameStyle -> Directive[Black, 18], 
BaseStyle -> {FontSize -> 16, FontFamily -> Times},
PlotLegends -> Automatic, PlotTheme -> "Scientific"
]

As you see in the following figure, the labels of the plot are italic, but not the kind we need in scientific papers.

enter image description here

What I need is this:

enter image description here

Is there any way to get this kind of "italic" font? I know that MaTex may work, but I'm looking for an easier way. I tried installing MaTex, but never succeeded.

$\endgroup$
7
  • $\begingroup$ Are you looking for a font recommendation? $\endgroup$
    – george2079
    Apr 2, 2018 at 17:41
  • 2
    $\begingroup$ you may use $FontFamilies to see the fonts available on your system and try one that looks like what you need by replacing FontFamily -> Times with the new font. For example, on my mac there's a font "Calisto MT" that may fit, via FontFamily -> "Calisto MT" $\endgroup$ Apr 2, 2018 at 17:47
  • $\begingroup$ I would use Subscript[x, g] instead of the inscrutable "\!\(\*SubscriptBox[\(x\), \(g\)]\)". If p is your plot, what does Options[p] return? $\endgroup$
    – Carl Woll
    Apr 2, 2018 at 18:24
  • $\begingroup$ MaTeX is really powerful once you have installed it, and there is a paclet installer. See github.com/szhorvat/MaTeX $\endgroup$
    – SPPearce
    Apr 2, 2018 at 18:27
  • $\begingroup$ Perhaps FontFamily -> "Times New Roman" $\endgroup$
    – Bob Hanlon
    Apr 2, 2018 at 20:27

2 Answers 2

7
$\begingroup$

Joining the answer by José and a comment by egwene:

{#, Style[
     "\!\(\*SubscriptBox[\(x\), \(g\)]\)  \!\(\*SubscriptBox[\(p\),   \(g\)]\)",
     FontSlant -> Italic, FontFamily -> #, 32]} & /@ $FontFamilies // Grid

gives a list in which many fonts provide outputs similar to what is desired.

$FontFamilies // Length yields 285, so for the sake of sanity only first 40 fonts are displayed in the image below.

enter image description here

$\endgroup$
1
6
$\begingroup$

Maybe you are looking for the fontname "Euclid". However, be advised that you must have this font installed in your system:

Style["\!\(\*SubscriptBox[\(x\), \(g\)]\)  \!\(\*SubscriptBox[\(P\), \
      \(g\)]\)", FontSlant -> Italic, FontFamily -> "Euclid", 32]

enter image description here

You should be also be aware about the font recommended for the plots in the journal you want to publish your paper (often, Times or Arial).

Style["\!\(\*SubscriptBox[\(x\), \(g\)]\)  \!\(\*SubscriptBox[\(P\), \
      \(g\)]\)", FontSlant -> Italic, FontFamily -> "Times", 32]

enter image description here

$\endgroup$
2
  • $\begingroup$ I tried elucid as you recommended, but it did not work. I had installed that on my system. $\endgroup$
    – Saeid
    Apr 2, 2018 at 19:29
  • $\begingroup$ Sounds bizarre. Anyway, and after seeing your font request in detail in your second fig, I would bet on "Times" as the font you are looking for. You can also take a look at the answer by @corey979 $\endgroup$ Apr 2, 2018 at 19:33

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.