From 5b60f8a2940f840a35788853cde573033ccbeb3b Mon Sep 17 00:00:00 2001 From: David Stansby Date: Mon, 4 Mar 2019 13:54:58 +0000 Subject: [PATCH] Backport PR #13578: 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