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

Function test_label_colours

lib/matplotlib/tests/test_table.py:54–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53@image_comparison(['table_labels.png'], style='mpl20')
54def test_label_colours():
55 dim = 3
56
57 c = np.linspace(0, 1, dim)
58 colours = plt.colormaps["RdYlGn"](c)
59 cellText = [['1'] * dim] * dim
60
61 fig = plt.figure()
62
63 ax1 = fig.add_subplot(4, 1, 1)
64 ax1.axis('off')
65 ax1.table(cellText=cellText,
66 rowColours=colours,
67 loc='best')
68
69 ax2 = fig.add_subplot(4, 1, 2)
70 ax2.axis('off')
71 ax2.table(cellText=cellText,
72 rowColours=colours,
73 rowLabels=['Header'] * dim,
74 loc='best')
75
76 ax3 = fig.add_subplot(4, 1, 3)
77 ax3.axis('off')
78 ax3.table(cellText=cellText,
79 colColours=colours,
80 loc='best')
81
82 ax4 = fig.add_subplot(4, 1, 4)
83 ax4.axis('off')
84 ax4.table(cellText=cellText,
85 colColours=colours,
86 colLabels=['Header'] * dim,
87 loc='best')
88
89
90@image_comparison(['table_cell_manipulation.png'], style='mpl20')

Callers

nothing calls this directly

Calls 3

figureMethod · 0.80
add_subplotMethod · 0.80
axisMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…