I am trying to plot two graphs separately, but i couldn't. For this problem i have two lists, which are like:
year=[1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959]
pop=[2.53, 2.57, 2.62, 2.67, 2.71, 2.76, 2.81, 2.86, 2.92, 2.97]
Then i made a code which is:
import matplotlib.pyplot as plt
# Make a line plot: year on the x-axis, pop on the y-axis
a=plt.plot(year,pop)
# Make a scatter plot: year on the x-axis, pop on the y-axis
b=plt.scatter(year,pop)
#show them
plt.show()
Of course i know that this plot both in same graph, i read this post but i couldn't fix my code. I am just a beginner so i came here for some help. Would you help me?
EDIT
I do not know really how to implement what is in the other answer, because i've never used plt.figure yet..
I think something like add_subplot
should be used but don't know how.