Bug summary
When annotation texts are removed and re-added to the axes, they become obscured in the second plot.
Code for reproduction
import matplotlib.pyplot as plt
import numpy as np
linestyles = [
('Solid', 'solid'),
('Dotted', 'dotted'),
('Dashed', 'dashed'),
('Dashdot', 'dashdot')]
fig, ax = plt.subplots()
ax.set(ylim=(-0.5, len(linestyles)-0.5), yticks=np.arange(len(linestyles)), yticklabels=[name for name, _ in linestyles])
texts = []
for i, (name, linestyle) in enumerate(linestyles):
text = ax.annotate(repr(linestyle), xy=(0.0, i), xycoords=ax.get_yaxis_transform(), xytext=(-6, -12), textcoords='offset points', ha='center', fontsize=12, color='blue')
texts.append(text)
plt.savefig('plot1.png')
for text in texts: text.remove()
for text in texts: ax.add_artist(text)
plt.savefig('plot2.png')
Actual outcome
plot1.png
plot2.png
Expected outcome
plot1.png
plot2.png
Additional information
No response
Operating system
No response
Matplotlib Version
0.2.0.dev54528+unknown.gf4cf12592
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
Bug summary
When annotation texts are removed and re-added to the axes, they become obscured in the second plot.
Code for reproduction
Actual outcome
plot1.png
plot2.png
Expected outcome
plot1.png
plot2.png
Additional information
No response
Operating system
No response
Matplotlib Version
0.2.0.dev54528+unknown.gf4cf12592
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None