Commit 9127a70
FIX: Polar Radial Tick Warnings Labels Bug (matplotlib#31577)
* Fix polar RadialLocator triggering spurious UserWarning in set_ticklabels
Extend the FixedLocator isinstance check in Axis.set_ticklabels and
_set_formatter to also recognise locators that wrap a FixedLocator via
a .base attribute (e.g. RadialLocator used by polar axes). Previously
calling set_ticks(ticks, labels) or set_ticklabels(labels) on a polar
axis would always hit the else branch and emit a spurious warning
because RadialAxis.set_major_locator automatically wraps any locator in
a RadialLocator, hiding the inner FixedLocator from the isinstance check.
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>1 parent d86ced4 commit 9127a70
2 files changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1999 | 1999 | | |
2000 | 2000 | | |
2001 | 2001 | | |
2002 | | - | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
2003 | 2005 | | |
2004 | 2006 | | |
2005 | 2007 | | |
| |||
2142 | 2144 | | |
2143 | 2145 | | |
2144 | 2146 | | |
2145 | | - | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
2146 | 2153 | | |
2147 | 2154 | | |
2148 | | - | |
| 2155 | + | |
2149 | 2156 | | |
2150 | 2157 | | |
2151 | | - | |
| 2158 | + | |
2152 | 2159 | | |
2153 | 2160 | | |
2154 | | - | |
| 2161 | + | |
2155 | 2162 | | |
2156 | 2163 | | |
2157 | 2164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
0 commit comments