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

Function test_specgram_origin_rcparam

lib/matplotlib/tests/test_axes.py:6068–6082  ·  view source on GitHub ↗

Test specgram ignores image.origin rcParam and uses origin 'upper'.

(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

6066
6067@check_figures_equal()
6068def test_specgram_origin_rcparam(fig_test, fig_ref):
6069 """Test specgram ignores image.origin rcParam and uses origin 'upper'."""
6070 t = np.arange(500)
6071 signal = np.sin(t)
6072
6073 plt.rcParams["image.origin"] = 'upper'
6074
6075 # Reference: First graph using default origin in imshow (upper),
6076 fig_ref.subplots().specgram(signal)
6077
6078 # Try to overwrite the setting trying to flip the specgram
6079 plt.rcParams["image.origin"] = 'lower'
6080
6081 # Test: origin='lower' should be ignored
6082 fig_test.subplots().specgram(signal)
6083
6084
6085def test_specgram_origin_kwarg():

Callers

nothing calls this directly

Calls 2

specgramMethod · 0.80
subplotsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…