7
$\begingroup$

I'd like to align a FrameLabel right.

For example: Plot[L[z], {z, 0.32, 1}, PlotRange -> {All, All}, Frame -> True, GridLines -> Automatic, LabelStyle -> {Black, 19}, Axes -> False, FrameLabel -> {"Distance (nm)", "Potencial (Nm)"}]

enter image description here

In this case the plot will have FrameLabels aligned to the center.

$\endgroup$

2 Answers 2

5
$\begingroup$
Plot[Exp[z], {z, 0.32, 1},
 PlotRange -> {All, All},
 Frame -> True,
 GridLines -> Automatic,
 LabelStyle -> {Black, 19},
 Axes -> False,
 FrameLabel -> {
   Row[{Spacer@180, "Distance (nm)"}],
   Row[{Spacer@50, "Potencial  (Nm)"}]}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you, I like this because it alters less of my code. $\endgroup$
    – A. Vieira
    Aug 7, 2017 at 9:31
7
$\begingroup$

You could use Labeled outside of the Graphics object. For example:

Labeled[
    Graphics[{}, Frame->True], 
    {"vertical label", "horizontal label"},
    {{Left, Top}, {Bottom, Right}},
    RotateLabel -> True
]

enter image description here

$\endgroup$
2
  • $\begingroup$ Unrelated question: I was taken by the font in your labels; it looks very pleasant to me. A quick online font-matching brings up Ubuntu Mono as the best match. Is that what yours is? (+1, btw). $\endgroup$
    – MarcoB
    Aug 4, 2017 at 17:44
  • 1
    $\begingroup$ @MarcoB I think it's just the default font in 11.1, "Source Sans Pro". $\endgroup$
    – Carl Woll
    Aug 4, 2017 at 19:10

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.