From 8cf5d3c44269623e76b6543a3108ae9770d07d45 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 3 Mar 2019 22:12:53 +0100 Subject: [PATCH] Revert invalid change in Centered Ticklabels example --- examples/ticks_and_spines/centered_ticklabels.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/ticks_and_spines/centered_ticklabels.py b/examples/ticks_and_spines/centered_ticklabels.py index 3e59f2966f4a..308ac3bb1121 100644 --- a/examples/ticks_and_spines/centered_ticklabels.py +++ b/examples/ticks_and_spines/centered_ticklabels.py @@ -7,7 +7,8 @@ associates a label with a tick, and the label can be aligned 'center', 'left', or 'right' using the horizontal alignment property:: - ax.xaxis.set_tick_params(horizontalalignment='right') + for label in ax.xaxis.get_xticklabels(): + label.set_horizontalalignment('right') but this doesn't help center the label between ticks. One solution is to "fake it". Use the minor ticks to place a tick centered