Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a4a897

Browse files
committed
Add "c" shorthand for "color" for the Text class.
... for consistency with Line2D.
1 parent 6013532 commit 1a4a897

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
`Text` gained the ``c`` alias for the ``color`` property
2+
````````````````````````````````````````````````````````
3+
4+
For consistency with `Line2D`, the `Text` class gained the ``c``
5+
alias for the ``color`` property; one is thus now allowed to write
6+
``ax.text(.5, .5, "foo", c="red")``.

lib/matplotlib/text.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def _get_textbox(text, renderer):
9696

9797

9898
@cbook._define_aliases({
99+
"color": ["c"],
99100
"fontfamily": ["family"],
100101
"fontproperties": ["font_properties"],
101102
"horizontalalignment": ["ha"],

0 commit comments

Comments
 (0)