Annotation does not appear in matplotlib plot
matplotlib, python
Solution
In the first example, calling `figure()` sets `xlim` and `ylim` to `[0,1]` with the text within the domain, at `[.2,.2]`.
In the second example the annotated test is outside the xlim and ylim. They are set automatically to `[-.06,.06]` (at least on my machine).
In the second example, simply invoke
ax.set_xlim(-.4,.4)
ax.set_xlim(-.4,.4)
and the annotation will appear in the figure.
Problem
The annotation "test" displays if I run the following code: ``` import matplotlib.pyplot as plt plt.figure() ax = plt.gca() ax.annotate("Test", xy=(0.2, 0.2)) ``` However, the exact same code will not display the annotation if I call `plt.plot()` instead of `plt.figure()`: ``` import matplotlib.pyplot as plt plt.plot() ax = plt.gca() ax.annotate("Test", xy=(0.2, 0.2)) ``` Why does the second code block not show the annotation?