8000 The Artist property rasterized cannot be None anymore by timhoffm · Pull Request #18989 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

The Artist property rasterized cannot be None anymore #18989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/behavior/18988-TH.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The Artist property *rasterized* cannot be *None* anymore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is now a bool only. Before the default was non and `.Artist.set_rasterized`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is now a bool only. Before the default was non and `.Artist.set_rasterized`
It is now a bool only. Before the default was *None* and `.Artist.set_rasterized`

Copy link
Member Author
@timhoffm timhoffm Nov 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only use None as a default, if that default is not a simple data type (e.g. depends on rcParams or is an object; e.g. a Norm). If the default is a bool like here, we use that directly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you merge with the typo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops. I was so distracted by your confusion 😃. Corrected in #18996.

documented to accept *None*. However, *None* did not have a special meaning
and was treated as *False*.
4 changes: 2 additions & 2 deletions lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(self):
self._label = ''
self._picker = None
self._contains = None
self._rasterized = None
self._rasterized = False
self._agg_filter = None
# Normally, artist classes need to be queried for mouseover info if and
# only if they override get_cursor_data.
Expand Down Expand Up @@ -898,7 +898,7 @@ def set_rasterized(self, rasterized):

Parameters
----------
rasterized : bool or None
rasterized : bool
"""
if rasterized and not hasattr(self.draw, "_supports_rasterization"):
cbook._warn_external(
Expand Down
0