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

Function test_mixed_collection

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

Source from the content-addressed store, hash-verified

5916
5917@image_comparison(['mixed_collection'], remove_text=True, style='_classic_test')
5918def test_mixed_collection():
5919 # First illustrate basic pyplot interface, using defaults where possible.
5920 fig, ax = plt.subplots()
5921
5922 c = mpatches.Circle((8, 8), radius=4, facecolor='none', edgecolor='green')
5923
5924 # PDF can optimize this one
5925 p1 = mpl.collections.PatchCollection([c], match_original=True)
5926 p1.set_offsets([[0, 0], [24, 24]])
5927 p1.set_linewidths([1, 5])
5928
5929 # PDF can't optimize this one, because the alpha of the edge changes
5930 p2 = mpl.collections.PatchCollection([c], match_original=True)
5931 p2.set_offsets([[48, 0], [-32, -16]])
5932 p2.set_linewidths([1, 5])
5933 p2.set_edgecolors([[0, 0, 0.1, 1.0], [0, 0, 0.1, 0.5]])
5934
5935 ax.patch.set_color('0.5')
5936 ax.add_collection(p1)
5937 ax.add_collection(p2)
5938
5939 ax.set_xlim(0, 16)
5940 ax.set_ylim(0, 16)
5941
5942
5943def test_subplot_key_hash():

Callers

nothing calls this directly

Calls 6

add_collectionMethod · 0.80
subplotsMethod · 0.45
set_offsetsMethod · 0.45
set_colorMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…