From 968c10c7442e2de2ae1e97786e4070f12929f0c8 Mon Sep 17 00:00:00 2001 From: Bingyao Liu Date: Mon, 29 Jul 2019 00:41:08 +0800 Subject: [PATCH] Make matplotlib.style.available sorted alphabetically. --- lib/matplotlib/style/core.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/style/core.py b/lib/matplotlib/style/core.py index 032978eb1e7c..2db68f7f1641 100644 --- a/lib/matplotlib/style/core.py +++ b/lib/matplotlib/style/core.py @@ -83,8 +83,6 @@ def use(style): | list | A list of style specifiers (str or dict) applied from first | | | to last in the list. | +------+-------------------------------------------------------------+ - - """ style_alias = {'mpl20': 'default', 'mpl15': 'classic'} @@ -218,5 +216,8 @@ def update_nested_dict(main_dict, new_dict): def reload_library(): """Reload style library.""" global library - available[:] = library = update_user_library(_base_library) + library = update_user_library(_base_library) + available[:] = sorted(library.keys()) + + reload_library()