I am trying to figure out how matplotlib annotaitons work and I tried the following:
fig = plt.figure()
ax = fig.add_subplot(111, autoscale_on=False, ylim=(1, 9000000))
plt.plot(df['month'], df['France'], label='France')
plt.plot(df['month'], df['Germany'], label='Germany')
ax.annotate('test', xy=(100, 1000), xytext=(3, 1.5),
arrowprops=dict(facecolor='black', shrink=0.05),
)
fig.set_size_inches(15, 7)
plt.legend(loc=2)
plt.show()
It is giving me a plot area, but is not showing the lines or the annotations. Any thoughts?
The following works and gives me a graph, but no annotations, obviously:
fig = plt.figure()
ax = fig.add_subplot(autoscale_on=False, ylim=(1, 9000000))
plt.plot(df['month'], df['France'], label='France')
plt.plot(df['month'], df['Germany'], label='Germany')
fig.set_size_inches(15, 7)
plt.legend(loc=2)
plt.show()