MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_maxn_major

Method test_maxn_major

lib/matplotlib/tests/test_ticker.py:480–493  ·  view source on GitHub ↗

When the axis is zoomed, the locator must have the same behavior as MaxNLocator.

(self, lims)

Source from the content-addressed store, hash-verified

478
479 @pytest.mark.parametrize("lims", ref_maxn_limits)
480 def test_maxn_major(self, lims):
481 """
482 When the axis is zoomed, the locator must have the same behavior as
483 MaxNLocator.
484 """
485 loc = mticker.LogitLocator(nbins=100)
486 maxn_loc = mticker.MaxNLocator(nbins=100, steps=[1, 2, 5, 10])
487 for nbins in (4, 8, 16):
488 loc.set_params(nbins=nbins)
489 maxn_loc.set_params(nbins=nbins)
490 ticks = loc.tick_values(*lims)
491 maxn_ticks = maxn_loc.tick_values(*lims)
492 assert ticks.shape == maxn_ticks.shape
493 assert (ticks == maxn_ticks).all()
494
495 @pytest.mark.parametrize("lims", ref_basic_limits + ref_maxn_limits)
496 def test_nbins_major(self, lims):

Callers

nothing calls this directly

Calls 4

set_paramsMethod · 0.95
set_paramsMethod · 0.95
tick_valuesMethod · 0.95
tick_valuesMethod · 0.95

Tested by

no test coverage detected