For a simple bar chart, I want some of my x-tick labels to be below the x-axis (for positive y-values) while others are above the x-axis (for negative y-values).
I see, per the docs, that a string can be passed as an argument to matplotlib.axes.Axes.set_xticklabel
to change vertical alignment, but this is a blanket application.
How would I achieve arbitrary positioning of particular x-tick labels?
You can modify the position / rotation of the labels in a for loop. Initially, I thought changing the rotation point would be enough, but the labels are anchored at the tip of the ticks, so the result was sub-optimal.
This is my code. You may want to tweak the y position in plus or minus to get the alignment that you want: