From 69e540caf71f4d7fc00aadd933f45870670ec7f2 Mon Sep 17 00:00:00 2001 From: Antony Lee <anntzer.lee@gmail.com> Date: Sun, 17 Feb 2019 19:55:44 +0100 Subject: [PATCH] Add "c" as alias for "color" for Collections ... for consistency with Line2D, as well as the already existing "ec" and "fc" aliases for "edgecolor" and "facecolor". --- doc/users/next_whats_new/2019-02-17-AL.rst | 8 ++++++++ lib/matplotlib/collections.py | 1 + 2 files changed, 9 insertions(+) create mode 100644 doc/users/next_whats_new/2019-02-17-AL.rst diff --git a/doc/users/next_whats_new/2019-02-17-AL.rst b/doc/users/next_whats_new/2019-02-17-AL.rst new file mode 100644 index 000000000000..ff703ffedcf6 --- /dev/null +++ b/doc/users/next_whats_new/2019-02-17-AL.rst @@ -0,0 +1,8 @@ +`Collection` gained the ``c`` alias for the ``color`` property +`````````````````````````````````````````````````````````````` + +For consistency with functions returning `Line2D`\s (e.g. `~Axes.plot`), the +color of the artists returned by functions returning `Collection` subclasses +(e.g. `~Axes.fill_between`) can now be set using the ``c`` shorthand (e.g. +``ax.fill_between(..., c="red")``) -- except for `~Axes.scatter`, which already +has a ``c`` parameter. diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index af6f8ed12a98..86cae697e0aa 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -21,6 +21,7 @@ @cbook._define_aliases({ "antialiased": ["antialiaseds", "aa"], + "color": ["c"], "edgecolor": ["edgecolors", "ec"], "facecolor": ["facecolors", "fc"], "linestyle": ["linestyles", "dashes", "ls"],