3
$\begingroup$

I have the following code:

    Plot1 = Plot[Exp[-0.03*t], {t, 0, 300}, 
   AxesLabel -> {None, "testing1"}];

Labeled[Plot1, "testing"]

I am trying to figure out how to make the font associated with the Labeled function match that of the Plot function. Does anyone know what font the Plot function uses?

$\endgroup$
1
  • 2
    $\begingroup$ Use the option PlotLabel, i.e., Plot1 = Plot[Exp[-0.03*t], {t, 0, 300}, AxesLabel -> {None, "testing1"}, PlotLabel -> "testing"] $\endgroup$
    – Bob Hanlon
    Commented Apr 18, 2022 at 2:36

2 Answers 2

5
$\begingroup$

Your code is:

Plot1 = Plot[Exp[-0.03*t], {t, 0, 300}, 
   AxesLabel -> {None, "testing1"}];
Labeled[Plot1, "testing"];

You can check the font in the following manner

CurrentValue[{StyleDefinitions, "Graphics", FontFamily}]

arial

And, hence, you should do LabelStyle -> {FontFamily -> "Arial"} in the Labeled to match the font. You can do on top of that LabelStyle -> {Small, FontFamily -> "Arial"} to match the size. Altogether you obtain

Plot1 = Plot[Exp[-0.03*t], {t, 0, 300}, 
   AxesLabel -> {None, "testing1"}, 
   AxesStyle -> {Small, FontFamily -> "Arial"}];
Labeled[Plot1, "testing", 
 LabelStyle -> {Small, FontFamily -> "Arial"}]

plot

Edit: to get more information you can use

CurrentValue[{StyleDefinitions, "Graphics"}]

info

$\endgroup$
2
$\begingroup$

Define your styles:

blue[a_] := Style[a, Blue, 12, FontFamily -> "Courier"]

red[a_] := Style[a, Red, 16, FontFamily -> "Arial"]

Using PlotLabel

Plot[Exp[-0.03*t], {t, 0, 300},
 AxesLabel -> {None, blue["test_1"]},
 PlotLabel -> blue["test"]]

enter image description here

Using Labeled

Labeled[
 Plot[Exp[-0.03*t], {t, 0, 300},
  AxesLabel -> {None, red["test_1"]}],
 red["test"]]

enter image description here

$\endgroup$

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.