I have made a figure with this code, where multiple plots are shown together:
Show[{
Plot[-x, {x, 0, 1}, PlotStyle -> Directive[Thick]],
Plot[-x + 1, {x, 1, 2}, PlotStyle -> Directive[Thick]],
Plot[-x + 2, {x, 2, 3}, PlotStyle -> Directive[Thick]]
},
PlotRange -> All,
AxesLabel -> {l, v[x]},
LabelStyle -> Directive[FontSize -> 12],
GridLines -> Automatic,
GridLinesStyle -> Directive[Gray, Dashed],
ImageSize -> {500},
PlotRangePadding -> 0]
Now, the result looks like:
As you can see, the plot shows the x-axis ticks labels in the middle of gridlines and plot curves. I would rather prefer, instead, that my labels for the x axis were above the axis. How can I achieve that? Is there a general command to move the labels "at will"?
I had previously a look to this post: Is it possible to position ticklabels on the negative y axis on its right side?
but with no results.
Edit: For sake of explaining myself better, I am adding some more info.. I am looking for general (and possibly simple) way to solve the problem of ticks label positioning.
In fact, for another case as
Show[{Plot[-6 x + 3, {x, 0, 1}, PlotStyle -> Directive[Thick]],
Plot[-6 x + 9, {x, 1, 2}, PlotStyle -> Directive[Thick]],
Plot[-6 x + 15, {x, 2, 3}, PlotStyle -> Directive[Thick]]},
PlotRange -> All, AxesLabel -> {l, T[x]},
LabelStyle -> Directive[FontSize -> 12], GridLines -> Automatic,
GridLinesStyle -> Directive[Gray, Dotted], ImageSize -> {500}]
it gives:
In that case, using frame instead of axes gives the undesired effect of having the x-axis offset from the (0,0). Simply rewriting labels will have the drawback of not having ticks.
I understand that in some way one should extract the ticks and the text separately from AbsoluteOptions, and then maintaining ticks and moving the labels (all together or one by one) in another position with respect to the standard one. I can extract ticks from:
p = Show[{Plot[-6 x + 3, {x, 0, 1}, PlotStyle -> Directive[Thick]],
Plot[-6 x + 9, {x, 1, 2}, PlotStyle -> Directive[Thick]],
Plot[-6 x + 15, {x, 2, 3}, PlotStyle -> Directive[Thick]]}];
myticks = Ticks /. AbsoluteOptions[p]
However I do not know how to do exactly the repositioning.