1
$\begingroup$

I'm using FrameTicks and Frame to get a second y-axis. But then my axes labels disappear. I've solved it by using Framelabel instead, but was wondering why this happens, and if there is a solution where you can still use AxisLabel?

The labels show up in the first plot, but not in the second one.

F[x_] := 2 x

Plot[{F[x]}, {x, 1, 100}, 
  AxesLabel -> {HoldForm[Subscript["R", \[Null] "⊥,max" \[Null]] [cm] ]} ]

Plot[{F[x]}, {x, 1, 100}, 
  Frame -> {{True, True}, {True, True}}, 
  FrameTicks -> {{All, All}, {All, None}}, 
  AxesLabel -> {t, HoldForm[Subscript["R", \[Null] "⊥,max" \[Null]] [cm] ]} ]
$\endgroup$
0

2 Answers 2

4
$\begingroup$

Use PlotRangePadding to make enough room in the plot for the axes to appear.

Plot[2 x, {x, 1, 100},
  Frame -> True,
  FrameTicks -> {{All, All}, {All, None}},
  PlotRangePadding ->
    {{Scaled[.11], Automatic}, {Scaled[.1], Automatic}},
  AxesLabel -> {HoldForm[Subscript["R", "⊥,max"][cm]], t}]

plot

$\endgroup$
3
  • $\begingroup$ Maybe he wanted the labels the other way around, but the general idea works anyway (+1). $\endgroup$
    – Jens
    Commented Jul 24, 2015 at 19:21
  • $\begingroup$ @Jens. It's hard to say. The unframed plot has the HoldForm[Subscript["R", "\[UpTee],max"][cm]] label along the x-axis. I thought it best to retain that, so I put t on the y-axis. $\endgroup$
    – m_goldberg
    Commented Jul 24, 2015 at 19:25
  • $\begingroup$ Indeed, you're probably right. $\endgroup$
    – Jens
    Commented Jul 24, 2015 at 19:27
1
$\begingroup$

Instead of "AxesLabel" use "FrameLabel".

F[x_] := 2x
Plot[{F[x]}, {x, 1, 100},
 Frame -> {{True, True}, {True, True}},
 FrameTicks -> {{All, All}, {All, None}}, 
 FrameLabel -> {t, HoldForm[Subscript["R", \[Null]*"\[UpTee],max"*\[Null]][cm]]}]

Plot y=2x with frame and labels

$\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.