From 5481b873d4c3cca6a8f9aab123291d5d50191091 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 21 Nov 2020 00:02:57 +0100 Subject: [PATCH 1/3] 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/api/next_api_changes/behavior/18988-TH.rst | 5 +++++ lib/matplotlib/artist.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 doc/api/next_api_changes/behavior/18988-TH.rst diff --git a/doc/api/next_api_changes/behavior/18988-TH.rst b/doc/api/next_api_changes/behavior/18988-TH.rst new file mode 100644 index 000000000000..4a87b4e97082 --- /dev/null +++ b/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. \ No newline at end of file diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 0d042a66d38c..b3251e60f191 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -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. @@ -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( From d74b766396f12f78418cb1c2bd7547f41021b87a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 21 Nov 2020 13:16:20 -0500 Subject: [PATCH 2/3] DOC: add missing markup --- doc/api/next_api_changes/behavior/18988-TH.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/next_api_changes/behavior/18988-TH.rst b/doc/api/next_api_changes/behavior/18988-TH.rst index 4a87b4e97082..0d5d839e26a8 100644 --- a/doc/api/next_api_changes/behavior/18988-TH.rst +++ b/doc/api/next_api_changes/behavior/18988-TH.rst @@ -2,4 +2,4 @@ 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. \ No newline at end of file +and was treated as *False*. From c901c93eb653de70a59294c1e08f1dda74259c6a Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 22 Nov 2020 14:02:21 +0100 Subject: [PATCH 3/3] Fix unresolved reference. --- doc/api/next_api_changes/behavior/18988-TH.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/next_api_changes/behavior/18988-TH.rst b/doc/api/next_api_changes/behavior/18988-TH.rst index 0d5d839e26a8..bab43b4d1cd2 100644 --- a/doc/api/next_api_changes/behavior/18988-TH.rst +++ b/doc/api/next_api_changes/behavior/18988-TH.rst @@ -1,5 +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` +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*.