From ec2e83266b432583b38a9b0a5c971e5c3ef0dab6 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Mon, 28 Jun 2021 11:17:30 +0200 Subject: [PATCH] Don't sort boxstyles/arrowstyles/etc. alphabetically. We now have source order, which should be more semantically more meaningful. --- examples/shapes_and_collections/fancybox_demo.py | 2 +- lib/matplotlib/patches.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/shapes_and_collections/fancybox_demo.py b/examples/shapes_and_collections/fancybox_demo.py index 0d1588ad9e4a..ba80979ab0a2 100644 --- a/examples/shapes_and_collections/fancybox_demo.py +++ b/examples/shapes_and_collections/fancybox_demo.py @@ -21,7 +21,7 @@ fig = plt.figure(figsize=(4 / 1.5, figheight / 1.5)) fontsize = 0.3 * 72 -for i, stylename in enumerate(sorted(styles)): +for i, stylename in enumerate(styles): fig.text(0.5, (spacing * (len(styles) - i) - 0.5) / figheight, stylename, ha="center", size=fontsize, diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 7793c7808dd4..00df0943a57f 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -2138,7 +2138,7 @@ def _simpleprint_styles(_styles): {stylename: styleclass}, return a string rep of the list of keys. Used to update the documentation. """ - return "[{}]".format("|".join(map(" '{}' ".format, sorted(_styles)))) + return "[{}]".format("|".join(map(" '{}' ".format, _styles))) class _Style: @@ -2184,7 +2184,7 @@ def pprint_styles(cls): f'``{name}``', # [1:-1] drops the surrounding parentheses. str(inspect.signature(cls))[1:-1] or 'None') - for name, cls in sorted(cls._style_list.items())]] + for name, cls in cls._style_list.items()]] # Convert to rst table. col_len = [max(len(cell) for cell in column) for column in zip(*table)] table_formatstr = ' '.join('=' * cl for cl in col_len)