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

Function example_pcolor

lib/matplotlib/tests/test_constrainedlayout.py:31–41  ·  view source on GitHub ↗
(ax, fontsize=12)

Source from the content-addressed store, hash-verified

29
30
31def example_pcolor(ax, fontsize=12):
32 dx, dy = 0.6, 0.6
33 y, x = np.mgrid[slice(-3, 3 + dy, dy),
34 slice(-3, 3 + dx, dx)]
35 z = (1 - x / 2. + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2)
36 pcm = ax.pcolormesh(x, y, z[:-1, :-1], cmap='RdBu_r', vmin=-1., vmax=1.,
37 rasterized=True)
38 ax.set_xlabel('x-label', fontsize=fontsize)
39 ax.set_ylabel('y-label', fontsize=fontsize)
40 ax.set_title('Title', fontsize=fontsize)
41 return pcm
42
43
44@image_comparison(['constrained_layout1.png'], style='mpl20')

Callers 12

test_constrained_layout3Function · 0.85
test_constrained_layout4Function · 0.85
test_constrained_layout5Function · 0.85
test_constrained_layout6Function · 0.85
test_constrained_layout8Function · 0.85
test_constrained_layout9Function · 0.85
test_colorbar_locationFunction · 0.85
test_colorbar_alignFunction · 0.85

Calls 4

pcolormeshMethod · 0.80
set_xlabelMethod · 0.80
set_ylabelMethod · 0.80
set_titleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…