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

Function test_fill_units

lib/matplotlib/tests/test_axes.py:850–880  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

848
849@image_comparison(['fill_units.png'], savefig_kwarg={'dpi': 60}, style='mpl20')
850def test_fill_units():
851 import matplotlib.testing.jpl_units as units
852 units.register()
853
854 # generate some data
855 t = units.Epoch("ET", dt=datetime.datetime(2009, 4, 27))
856 value = 10.0 * units.deg
857 day = units.Duration("ET", 24.0 * 60.0 * 60.0)
858 dt = np.arange('2009-04-27', '2009-04-29', dtype='datetime64[D]')
859 dtn = mdates.date2num(dt)
860
861 fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2)
862
863 ax1.plot([t], [value], yunits='deg', color='red')
864 ind = [0, 0, 1, 1]
865 ax1.fill(dtn[ind], [0.0, 0.0, 90.0, 0.0], 'b')
866
867 ax2.plot([t], [value], yunits='deg', color='red')
868 ax2.fill([t, t, t + day, t + day],
869 [0.0, 0.0, 90.0, 0.0], 'b')
870
871 ax3.plot([t], [value], yunits='deg', color='red')
872 ax3.fill(dtn[ind],
873 [0 * units.deg, 0 * units.deg, 90 * units.deg, 0 * units.deg],
874 'b')
875
876 ax4.plot([t], [value], yunits='deg', color='red')
877 ax4.fill([t, t, t + day, t + day],
878 [0 * units.deg, 0 * units.deg, 90 * units.deg, 0 * units.deg],
879 facecolor="blue")
880 fig.autofmt_xdate()
881
882
883def test_plot_format_kwarg_redundant():

Callers

nothing calls this directly

Calls 5

autofmt_xdateMethod · 0.80
registerMethod · 0.45
subplotsMethod · 0.45
plotMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…