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

Function color_violins

lib/matplotlib/tests/test_axes.py:4357–4370  ·  view source on GitHub ↗

Helper to color parts manually.

(parts, facecolor=None, linecolor=None)

Source from the content-addressed store, hash-verified

4355 }
4356
4357 def color_violins(parts, facecolor=None, linecolor=None):
4358 """Helper to color parts manually."""
4359 if facecolor is not None:
4360 for pc in parts['bodies']:
4361 pc.set_facecolor(facecolor)
4362 # disable alpha Artist property to counter the legacy behavior
4363 # that applies an alpha of 0.3 to the bodies if no facecolor
4364 # was set
4365 pc.set_alpha(None)
4366 if linecolor is not None:
4367 for partname in ('cbars', 'cmins', 'cmaxes', 'cmeans', 'cmedians'):
4368 if partname in parts:
4369 lc = parts[partname]
4370 lc.set_edgecolor(linecolor)
4371
4372 # Reference image
4373 ax = fig_ref.subplots(1, 3)

Callers 1

Calls 3

set_facecolorMethod · 0.45
set_alphaMethod · 0.45
set_edgecolorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…