Skip to content

Commit

Permalink
The Artist property rasterized cannot be None anymore (#18989)
Browse files Browse the repository at this point in the history
* The Artist property rasterized cannot be None anymore

It is now a bool only. Before the default was non and
`Artist.set_rasterized` documented to accept *None*. However, *None*
did not have a special meaning and was treated as *False.

* DOC: add missing markup

* Fix unresolved reference.

Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
  • Loading branch information
timhoffm and tacaswell committed Nov 22, 2020
1 parent 3b9ec68 commit 87119ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/behavior/18988-TH.rst
@@ -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`
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
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 comments on commit 87119ea

Please sign in to comment.