A work-around that works with arbitrary number of axes: post-process to inject the option AxisLabel
to AxisObject
s:
ClearAll[fixMultiAxisLabels]
fixMultiAxisLabels[off_ : 1.5, opts : OptionsPattern[]] :=
Module[{al = #2},
ReplaceAll[Offset[o : Except[0, _], z_] :> Offset[off o, z]]@*
ReplaceAll[AxisObject[a_, b_, c___] :>
AxisObject[a, b, Last[al = RotateLeft[al]], opts, c]]@#] &;
Examples:
llp = ListLinePlot[{{1, 2, 3}, 10 {3, 2, 1}},
MultiaxisArrangement -> All, ImageSize -> 500];
labels = {"A", "B", "C", "D"};
axislabels = Thread[AxisLabel -> Placed @@@
Transpose[{labels, {0.5, {0.5, #}}&/@ {-2.5, 2.5, 2.5, -.5}}]]
fixMultiAxisLabels[][llp, axislabels]
llp2 = ListLinePlot[{10000 {1, 2, 3}, 10 10000 {3, 2, 1}},
MultiaxisArrangement -> All, ImageSize -> 500, LabelStyle -> 16];
axislabels2 = Thread[AxisLabel -> Placed @@@
Transpose[{labels, {0.5, {0.5, #}} & /@ {-3.5, 5, 2.5, -.5}}]]
fixMultiAxisLabels[][llp2, axislabels2]
An example with 4 vertical axes:
llp3 = ListLinePlot[{{1, 2, 3}, 10 {3, 2, 1}, 500 {2, 1, 3}, 1000 {1, 3, 2}},
MultiaxisArrangement -> All, ImageSize -> 800];
labels3 = {"left 1", "left 2", "right 1", "right 2", "bottom", "top"};
axislabels3 = Thread[AxisLabel -> Placed @@@
Transpose[{labels3, {0.5, {0.5, #}} & /@ {-2, -1.25, 3.25, 4, 2.5, -.5} }]];
fixMultiAxisLabels[2, LabelStyle -> 14][llp3, axislabels3]
InputForm
of that plot does not look right. Seems like a bug to me. You should report it to Wolfram Support. $\endgroup$MultiaxisArrangement
is used:PlotLegends
is ignored. $\endgroup$