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

Function test_contour_datetime_axis

lib/matplotlib/tests/test_contour.py:234–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233@image_comparison(['contour_datetime_axis.png'], style='mpl20')
234def test_contour_datetime_axis():
235 fig = plt.figure()
236 fig.subplots_adjust(hspace=0.4, top=0.98, bottom=.15)
237 base = datetime.datetime(2013, 1, 1)
238 x = np.array([base + datetime.timedelta(days=d) for d in range(20)])
239 y = np.arange(20)
240 z1, z2 = np.meshgrid(np.arange(20), np.arange(20))
241 z = z1 * z2
242 plt.subplot(221)
243 plt.contour(x, y, z)
244 plt.subplot(222)
245 plt.contourf(x, y, z)
246 x = np.repeat(x[np.newaxis], 20, axis=0)
247 y = np.repeat(y[:, np.newaxis], 20, axis=1)
248 plt.subplot(223)
249 plt.contour(x, y, z)
250 plt.subplot(224)
251 plt.contourf(x, y, z)
252 for ax in fig.get_axes():
253 for label in ax.get_xticklabels():
254 label.set_ha('right')
255 label.set_rotation(30)
256
257
258@image_comparison(['contour_test_label_transforms.png'],

Callers

nothing calls this directly

Calls 5

figureMethod · 0.80
subplots_adjustMethod · 0.80
set_rotationMethod · 0.80
contourMethod · 0.45
contourfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…