diff --git a/Gallery/XY/NCL_xy_16.py b/Gallery/XY/NCL_xy_16.py index c17ca6c37..ae5e85ae8 100644 --- a/Gallery/XY/NCL_xy_16.py +++ b/Gallery/XY/NCL_xy_16.py @@ -96,15 +96,14 @@ # Add legend handles, labels = ax.get_legend_handles_labels() -# Default order is the order in which the data was plotted -handles = reversed(handles) # Reverse order of legend elements -labels = reversed(labels) + plt.legend(handles, labels, loc='center right', frameon=False, fontsize=14, - labelspacing=1) + labelspacing=1, + reverse=True) plt.show() @@ -183,13 +182,13 @@ # Add legend handles, labels = ax.get_legend_handles_labels() # Default order is the order in which the data was plotted -handles = reversed(handles) # Reverse order of legend elements -labels = reversed(labels) + plt.legend(handles, labels, loc='center right', frameon=False, fontsize=14, - labelspacing=1) + labelspacing=1, + reverse=True) plt.show()