Sorry to ask such a basic question, but after hours (and hours) of frustration I'm turning to the list for some expert help.
I have two pandas dataframes, df1 and df2. df1 has columns A and B, while df2 has columns C and D. I want to use matplotlib to make a scatterplot of A vs. B, with labelled axes, and a histogram of C, also with a title on the x axis. Then I want to save both figures in pdf files.
I can accomplish the former with
import matplotlib.pyplot as plt
plt.scatter(df1['A'],df1['B'])
plt.xlabel('X title')
plt.ylabel('Y title')
plt.savefig('myfig1.pdf')
But I can't get the histogram to work, and if it does, it creates a graph with both the scatterplot and the histogram in it.
Any help greatly appreciated.
plt.hist(df3[C'])? What's the error message with the histogram creation?