I have a plot where I would like ticks shown on both the axes and the frame, with them labeled separately. I have custom labels for the frame and want the horizontal axis labeled with ticks automatically. Despite setting both the Ticks
and the Frame
properties, I cannot get the ticks to show up on the axes. Is there a way to do this without drawing the ticks manually or something like that? My example is shown below, I am able to get automatic ticks on the top of the frame, but these are not labeled either.
Plot[xt[t], {t, 0, .5*10^-3},
Ticks -> Automatic,
FrameLabel -> {{"x [m]", None}, {"t", None}},
Frame -> True,
FrameTicks -> {{Automatic, None}, {{{0, "t'"}, {.0005, "t'+5 ms"}}, Automatic}}]
Answer
As noticed in this topic it is impossible an could be confusing. The solution is as usual, Overlay
:)
With[{opt = Sequence[ImagePadding -> {{65, 25}, {40, 15}}, BaseStyle -> {Bold, 15}]},
Overlay@{
Plot[Sin[t], {t, 0, 2 Pi}, FrameLabel -> {{"x [m]", ""}, {"t", ""}}, Frame -> True,
FrameTicks -> {{Automatic, None}, {{{0, "t'"}, {2 Pi, "t'+5 ms"}}, Automatic}},
Axes -> False, opt],
Plot[Sin[t], {t, 0, 2 Pi}, Axes -> {True, False}, PlotStyle -> None, opt]
}]
Comments
Post a Comment