8000 Reverse stackplot legend to match data display · matplotlib/matplotlib@602a0ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 602a0ff

Browse files
authored
Reverse stackplot legend to match data display
This puts the legend key in the same order as the stacked data, with oceania at the top (near invisible), then europe, ..., with africa at the bottom.
1 parent 8293774 commit 602a0ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

galleries/examples/lines_bars_and_markers/stackplot_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
fig, ax = plt.subplots()
3131
ax.stackplot(year, population_by_continent.values(),
3232
labels=population_by_continent.keys(), alpha=0.8)
33-
ax.legend(loc='upper left')
33+
ax.legend(loc='upper left', reverse=True)
3434
ax.set_title('World population')
3535
ax.set_xlabel('Year')
3636
ax.set_ylabel('Number of people (millions)')

0 commit comments

Comments
 (0)
0