2
$\begingroup$

I want to use Times New Roman fonts in the text in my plots because symbols in Arial look awful and unprofessional. I had no trouble in v9, but in v11 I can't seem to get it to use TNR, and it defaults to Arial no matter what I try. Here is an example:

Show[Plot[{1.05-x^2/6,1.02-x^2/8},{x,0.05,.95},
FrameLabel->{Style[Text[\[CurlyEpsilon]],FontSize->28],
Style[Text["Subscript[R,\[Gamma]]"],FontSize->28]},
BaseStyle->{FontFamily->"Times New Roman",FontSize->20},
Frame->True,FrameStyle->Directive[Thick,Large],
PlotStyle->{{Blue, Dashing[0.015], Thick},{Thick,Red}},
ImageSize->Large,PlotRange->{{0,1},{.9,1.1}},
AxesOrigin->{0,0},
PlotLegends->Placed[{Style[Text["N"],26],
Style[Text["N+\[CapitalDelta]"],26]},{0.8,0.82}]],
ListLinePlot[{{0,1},{1,1}},PlotStyle->{Gray,Thickness[0.002]}],
Graphics[Text[Text[Style["<Q^2> = 0.85 GeV^2",24]],{0.25,1.08}]],
Graphics[Text[Text[Style["(a)",30]],Scaled[{0.1,0.13}]]]]

Here is the output from v11, followed by the output from v9. In v11 the text is Arial, and only the axes are in TNR. However the axes are grey, and not crisp like in v9. I would like to be able to change the font in the document, not in the default stylesheet.

v11 v9

$\endgroup$
2
  • $\begingroup$ Why Text["N"] rather than just "N"? $\endgroup$ Commented Mar 13, 2017 at 22:23
  • $\begingroup$ If you remove all those Texts and set LabelStyle -> {FontFamily -> "Times New Roman", FontSize -> 20} it looks much closer to the v9 result. $\endgroup$ Commented Mar 13, 2017 at 22:25

1 Answer 1

4
$\begingroup$

As Simon Woods notes in the comments, removing Text and using LabelStyle gets you most of the way there. Also, the frame is gray by default, for some reason, but can set it to be black in FrameStyle. And there's no need to draw a horizontal line using ListLinePlot, since the Axes will do it for you:

Plot[{1.05 - x^2/6, 1.02 - x^2/8}, {x, 0.05, .95}, 
 FrameLabel -> {ε, Subscript[R, γ]}, 
 BaseStyle -> {FontFamily -> "Times New Roman", 20}, 
 LabelStyle -> {FontFamily -> "Times New Roman"}, Frame -> True, 
 FrameStyle -> Directive[Black, Thick], 
 PlotStyle -> {{Blue, Dashing[0.015], Thick}, {Thick, Red}}, 
 ImageSize -> Large, PlotRange -> {{0, 1}, {.9, 1.1}}, 
 AxesOrigin -> {0, 1}, 
 PlotLegends -> 
  Placed[{N, HoldForm[N + Δ]}, {0.8, 0.82}], 
 Epilog -> {Text[Q^2 == 0.85 GeV^2, {.27, 1.08}], 
   Text["(a)", Scaled[{0.1, 0.13}]]}]

Mathematica graphics

Also, when making plots for journals, rather than doing all the work making lines thicker and fonts bigger, I like to show the plot at the actual journal size. Then the default font sizes, etc., are about right, and I can just magnify the plot if I want to see it bigger on-screen:

Magnify[Plot[{1.05 - x^2/6, 1.02 - x^2/8}, {x, 0.05, .95}, 
  FrameLabel -> {ε, Subscript[R, γ]}, 
  BaseStyle -> {FontFamily -> "Times New Roman"}, 
  LabelStyle -> {FontFamily -> "Times New Roman"}, Frame -> True, 
  FrameStyle -> Black, PlotStyle -> {{Blue, Dashing[0.015]}, {Red}}, 
  PlotRange -> {{0, 1}, {.9, 1.1}}, AxesOrigin -> {0, 1}, 
  PlotLegends -> 
   Placed[{N, HoldForm[N + Δ]}, {0.8, 0.82}], 
  Epilog -> {Text[Q^2 == 0.85 GeV^2, {.27, 1.08}], 
    Text["(a)", Scaled[{0.1, 0.13}]]}, ImageSize -> 3.5 72], 2]

Mathematica graphics

This has the additional advantage that you can use the same font size in the figures as in the text, and they will actually match in the document.

$\endgroup$
2
  • 1
    $\begingroup$ Why do you need Magnify, if we can directly adjust the size of the image using ImageSize? $\endgroup$ Commented Mar 13, 2017 at 23:16
  • 1
    $\begingroup$ @AnjanKumar Changing the size using ImageSize changes the size of the plot, but does not scale font sizes, line thicknesses, point sizes, etc., to match. So this scaling needs to be done by hand, as in the OP. If we keep the ImageSize at the size needed for the final document, and use the font size that is used in the rest of the document, then the fonts will all match without any scaling needed. A single column in a journal is about 3.5 inches, or thereabouts. Magnify is just for viewing on-screen in Mathematica, if you want to see a larger plot. $\endgroup$ Commented Mar 14, 2017 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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