Helper to color parts manually.
(parts, facecolor=None, linecolor=None)
| 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) |
no test coverage detected
searching dependent graphs…