2
$\begingroup$

I have a plot with labels positioned using the epilog function for convenience. I would like to increase the size of axes labels within the epilog function but I haven't managed to figure out a way to do so. I've read through a number of posts (post_1, post_2) but they all don't seem to address this problem. My codes are given below:

Plot[x^2 + 4 x, {x, -7, 6}, ImageSize -> 600,  
AxesStyle -> Arrowheads[{0, 0.03}], 
Epilog -> { Inset["x axis", Scaled[{0.5, 0.15}]], 
Inset["y axis", Scaled[{0.5, 0.95}]]}, 
PlotStyle -> {Thickness[0.007]}, 
LabelStyle -> Directive[Bold, Black, Medium]]

Any assistance would be appreciated.

$\endgroup$
4
  • 4
    $\begingroup$ Use Style on the argument of Inset to impose a style on the text labels: e.g. Style["x axis", FontSize -> 25] $\endgroup$
    – MarcoB
    Jul 7 '15 at 16:04
  • $\begingroup$ Thanks so much. Took a while to figure that one out. I'll post the solution below my question. $\endgroup$
    – John_dydx
    Jul 7 '15 at 16:12
  • 2
    $\begingroup$ John, glad to help. Answering your own question is highly encouraged here on stackexchange. Rather than adding the answer directly to the question, would you please post the solution as your own answer? That will make the question show up as answered to other people with a similar problem. $\endgroup$
    – MarcoB
    Jul 7 '15 at 16:23
  • $\begingroup$ Great, I'll do that. $\endgroup$
    – John_dydx
    Jul 7 '15 at 16:41
3
$\begingroup$

Edit: Thanks to MarcoB, here's the solution (this increases the size of the x axis label):

Plot[x^2 + 4 x, {x, -7, 6}, ImageSize -> 600,  
AxesStyle -> Arrowheads[{0, 0.03}], 
Epilog -> { 
Inset[Style["x axis", FontSize -> 25], Scaled[{0.5, 0.15}]], 
Inset["y axis", Scaled[{0.5, 0.95}]]}, 
PlotStyle -> {Thickness[0.007]}, 
LabelStyle -> Directive[Bold, Black, Medium]]
$\endgroup$

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