()
| 8593 | |
| 8594 | |
| 8595 | def test_secondary_minorloc(): |
| 8596 | fig, ax = plt.subplots(figsize=(10, 5)) |
| 8597 | ax.plot(np.arange(2, 11), np.arange(2, 11)) |
| 8598 | |
| 8599 | def invert(x): |
| 8600 | with np.errstate(divide='ignore'): |
| 8601 | return 1 / x |
| 8602 | |
| 8603 | secax = ax.secondary_xaxis('top', functions=(invert, invert)) |
| 8604 | assert isinstance(secax._axis.get_minor_locator(), |
| 8605 | mticker.NullLocator) |
| 8606 | secax.minorticks_on() |
| 8607 | assert isinstance(secax._axis.get_minor_locator(), |
| 8608 | mticker.AutoMinorLocator) |
| 8609 | ax.set_xscale('log') |
| 8610 | plt.draw() |
| 8611 | assert isinstance(secax._axis.get_minor_locator(), |
| 8612 | mticker.LogLocator) |
| 8613 | ax.set_xscale('linear') |
| 8614 | plt.draw() |
| 8615 | assert isinstance(secax._axis.get_minor_locator(), |
| 8616 | mticker.NullLocator) |
| 8617 | |
| 8618 | |
| 8619 | def test_secondary_formatter(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…