Created
June 1, 2014 22:25
-
-
Save munk/70dc375332c62e421111 to your computer and use it in GitHub Desktop.
Plotting dict of lists
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.pyplot as plt | |
data = {'a': [1, 2, 3], | |
'b': [9, 4, 2], | |
'c': [10, 12, 13]} | |
fig, ax = plt.subplots() | |
for name, value in data.items(): | |
ax.plot(value, label=name) | |
plt.ylabel('some numbers') | |
legend = ax.legend() | |
plt.show() |
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 pandas as pd | |
data = {'a': [1, 2, 3], | |
'b': [9, 4, 2], | |
'c': [10, 12, 13]} | |
df = pd.DataFrame(data) | |
df.plot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment