Fix limitation of clearing one plot when another one gets focus
Hi stsievert, what is the cause of this limitation? I very much would like to use that feature. Are there any ways to circumvent the issue? Multiple instances of python did not work.
Can you detail how to reproduce?
During development, I assumed only one figure would update at a time. It was assumed that subplots would be used if multiple images needed to updated at once.
Yes, I try to do it. Do you want code or a detailed setup? setup: Define two functions make_fig_a and make_fig_b (subplot already included). Also retrieve data from serial port and then call drawnow twice.
def make_fig_a(data):
subplot(1,2,1)
for item in list(data):
plt.plot(data[item], label=item)
def make_fig_a(data):
subplot(1,2,2)
for item in list(data):
plt.plot(data[item], label=item)
if __name__ == '__main__':
data1 = {'temp1' : []}
data2 = {'temp2' : []}
while True:
data1['temp1].append(5)
data2['temp2].append(5)
drawnow(make_fig_a(data=data1))
drawnow(make_fig_a(data=data1))
Thanks for the example. It looks like you have a typo in the last lines. I’ll put this on my todo list. It looks like it’s something with plt.clf, plt.show and plt.draw_all. I have to make all of these figure specific.