Created
October 20, 2020 09:11
-
-
Save seafooler/9858ec2d577d95157872ba90109a8928 to your computer and use it in GitHub Desktop.
Add the legend manually
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.patches as mpatches | |
import matplotlib.pyplot as plt | |
red_patch = mpatches.Patch(color='red', label='The red data') | |
blue_patch = mpatches.Patch(color='blue', label='The blue data') | |
plt.legend(handles=[red_patch, blue_patch]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment