Skip to content

Support 'markerfacecoloralt' in prop_cycle #17055

@Z4uit

Description

@Z4uit

Bug report

Bug summary

When using the cycler to style a series of plots, one cannot use markerfacecoloralt because it is not recognised as artist. Markerfacecolor and color are recognised.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np
from cycler import cycler

x = np.linspace(0,1,10)
B = [0,1,2,3]
colors = ['k', 'tab:gray', 'tab:red', 'tab:blue']

# Desired workflow
fig1,ax1 = plt.subplots()
ax1.set_prop_cycle(cycler('c',colors)+
                   cycler('markerfacecolor',colors)+
                   cycler('markerfacecoloralt',colors[::-1]))
for b in B:
    ax1.plot(x,x+b,'-o',markersize=7,fillstyle='top')

Actual outcome

ValueError: Unknown artist properties: {'markerfacecoloralt'}

Expected outcome
gitHub

# Workaround to get above plot
fig2,ax2 = plt.subplots()
ax2.set_prop_cycle(cycler('c',colors)+
                   cycler('markerfacecolor',colors))
for b,cAlt in zip(B,colors[::-1]):
    ax2.plot(x,x+b,'-o',markersize=7,markerfacecoloralt=cAlt,fillstyle='top')

Matplotlib version

  • Operating system: macOS Catalina 10.15.3
  • Matplotlib version: 3.2.1
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.7.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepItems to be ignored by the “Stale” Github Actiontopic: color/cycle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions