Closed
Description
Bug report
Bug summary
line.set_ydata
should update a drawn line, however this seems to break under some circumstances, depending on the background color.
Code for reproduction
fig,ax = plt.subplots(facecolor='none')
ax.set_facecolor('none')
plt.subplots_adjust(left=0.25, bottom=0.25)
plt.axis([0, 4, 0,2])
l, = ax.plot([1,2,3],[1,0,1])
ax.set_title('down')
def update():
l.set_ydata([1,2,1])
ax.set_title('up')
this creates a 'v' shape with title 'down' as expected, but then calling update()
leads to this:
It continuously draws over the previous plot. fig.canvas.draw()
doesn't help, but if I fig.savefig('test.jpg')
it updates correctly.
If the axis background is set to something else but 'none'
, the lines updates correctly, but the title doesn't. The title only update correctly, if also the figure background is something else but 'none'
.
Expected outcome
- The
update
function should immediately update the interactive figure.
Matplotlib version
- Matplotlib version: 2.0.0
- Python version: 3.6.0 (but same issue with 2.7.13)
- Platform: OSX
- How did you install Matplotlib and Python: anaconda