I want the axes' digits of my plots (actually ListLinePlots) to be free from the interference with other background elements (specifically grid lines). To do that I've tried specifying Background->White
in the TickLabels
option. However, since they're printed on top of the function curve, the white background of the labels hides the function curve when they happen to overlap. Here is a picture of the issue:
(The desired effect is as in the bottom label shown in the image, without the problem of the label circled in red.)
I would like the axes labels to lay in a layer between the background elements and the plotted curve. I have seen a couple of questions relevant to this (1 and 2), but they do not specifically address this issue. (Using Method -> {"AxesInFront" -> False}
solves indeed the problem when it's a Plot
, but has no effect with ListLinePlot
.)
Not sure if this is possible, but I was looking for some solution that does not use any external package.
Here is an example:
ListLinePlot[Table[2 x + 2, {x, -5, 5}],
PlotStyle -> Directive[Thick],
TicksStyle -> Directive[30, Black, Background -> White],
PlotTheme -> {"Grid"}, GridLinesStyle -> Plain,
Method -> {"AxesInFront" -> False}]
Epilog
? Also, what have you tried so far? Please provide a MWE for us to work off of to help you :) $\endgroup$Method -> {"AxesInFront" -> False}
does indeed work perfectly when we have aPlot
, but it has no effect when it's aListLinePlot
... $\endgroup$Plot
? Can you, perhaps, observe success when usingListPlot
? Did you see what Epilog does? Seemingly this is what you want. $\endgroup$Plot
, as opposed to the functionListLinePlot
. I haven't consideredEpilog
since that requires manual input of the label coordinates... and I have a very high number of plots that need to manage automatically. Even in that case wouldn'tEpilog
plot on top of everything? $\endgroup$Epilog
to plot the curve on top of everything. Also perhapsListPlot
works with the method you mention, usingJoined->True
. This would be convenient for your use if so. $\endgroup$