From 2dd81752c8a8a26f8d67a7f322bea78b9a0a2104 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 8 Sep 2025 23:59:38 +0200 Subject: [PATCH 1/2] MNT: Change default name of ListedColormaps from "from_list" to "unnamed", which makes more sense logically. While technically a breaking change, I anticipate that nobody is relying on that default value. --- doc/api/next_api_changes/behavior/30532-TH.rst | 4 ++++ lib/matplotlib/colors.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 doc/api/next_api_changes/behavior/30532-TH.rst diff --git a/doc/api/next_api_changes/behavior/30532-TH.rst b/doc/api/next_api_changes/behavior/30532-TH.rst new file mode 100644 index 000000000000..62bf481e1b75 --- /dev/null +++ b/doc/api/next_api_changes/behavior/30532-TH.rst @@ -0,0 +1,4 @@ +Default name of ``ListedColormap`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The default name of `ListedColormap` has changed from "from_list" to "unnamed". diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index f60c8eb48134..679f368bae30 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -1322,7 +1322,7 @@ class ListedColormap(Colormap): "and will be removed in %(removal)s. Please ensure the list " "of passed colors is the required length instead." ) - def __init__(self, colors, name='from_list', N=None, *, + def __init__(self, colors, name='unnamed', N=None, *, bad=None, under=None, over=None): if N is None: self.colors = colors From c6210d85b2b9c24032eec18f8e77daac18d2106d Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 9 Sep 2025 07:00:02 +0200 Subject: [PATCH 2/2] Update doc/api/next_api_changes/behavior/30532-TH.rst Co-authored-by: Elliott Sales de Andrade --- doc/api/next_api_changes/behavior/30532-TH.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/next_api_changes/behavior/30532-TH.rst b/doc/api/next_api_changes/behavior/30532-TH.rst index 62bf481e1b75..3d368c566039 100644 --- a/doc/api/next_api_changes/behavior/30532-TH.rst +++ b/doc/api/next_api_changes/behavior/30532-TH.rst @@ -1,4 +1,4 @@ Default name of ``ListedColormap`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The default name of `ListedColormap` has changed from "from_list" to "unnamed". +The default name of `.ListedColormap` has changed from "from_list" to "unnamed".

AltStyle によって変換されたページ (->オリジナル) /