0
$\begingroup$
Plot[Sin[x], {x, 0, Pi}, PlotTheme -> "Scientific", 
FrameLabel -> {"x (rad)", "Signal (%)"}, 
BaseStyle -> {FontSize -> 25, FontFamily -> "Latin Modern Math"}]

enter image description here How can I use two kinds of the font in FrameLabel at the same time?

Like, I want to let "(%)" in "Latin Modern Math" but others are in Times.

$\endgroup$

2 Answers 2

1
$\begingroup$

Edit: In principle the simplest answer is the same as this one: use the Show Fonts menu. However, that menu item is grayed out in Mathematica version 11.0.1 on macOS Sierra. The following is a workaround for that bug. End Edit

To make the desired adjustments interactively, select the % in your source code, then go to the menu Format > Option Inspector. It will open a pane that shows all the things you can modify for the current selection. Among them is Formatting Options > Font Options > FontFamily which you can now adjust using the drop-down menu.

screen shot

Once you press shift-enter, the label as you formatted it will be preserved because it's already wrapped in a StyleBox automatically, without you having to enter the code for it.

$\endgroup$
1
  • $\begingroup$ Thanks a lot, it's a very clear description :) $\endgroup$ Jul 14, 2017 at 9:17
1
$\begingroup$
FrameLabel -> {"x (rad)", 
  Row[
   {Text[Style["Signal", 24, FontFamily -> "Times"]], 
    Text[Style[" (%)", FontFamily -> "Latin Modern Math"]]}]}
$\endgroup$
1
  • $\begingroup$ Thanks! It works perfectly in some of my trivial and similar graphs! $\endgroup$ Jul 14, 2017 at 9:20

Your Answer

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

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