Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0656436

Browse filesBrowse files
committed
Merge pull request #3812 from jbmohler/deprecate_graylevel
API : insert deprecation warning for set_graylevel
2 parents 20425e2 + d1fd40c commit 0656436
Copy full SHA for 0656436

File tree

Expand file treeCollapse file tree

2 files changed

+11
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-0
lines changed
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Deprecated `GraphicsContextBase.set_graylevel`
2+
``````````````````````````````````````````````
3+
4+
The `GraphicsContextBase.set_graylevel` function has been deprecated in 1.5 and
5+
will be removed in 1.6. It has been unused. The
6+
`GraphicsContextBase.set_foreground` could be used instead.

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,11 @@ def set_graylevel(self, frac):
10111011
"""
10121012
Set the foreground color to be a gray level with *frac*
10131013
"""
1014+
# When removing, remember to remove all overrides in subclasses.
1015+
msg = ("set_graylevel is deprecated for removal in 1.6; "
1016+
"you can achieve the same result by using "
1017+
"set_foreground((frac, frac, frac))")
1018+
warnings.warn(msg, mplDeprecation)
10141019
self._rgb = (frac, frac, frac, self._alpha)
10151020

10161021
def set_joinstyle(self, js):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.