-
Is there a real time update code snippet for Hist library? I use matplotlib so can you give code with matplotlib? I want contiuously update the histogram from data acquisition thread and update display from UI thread. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi. Let me explicitly ping @henryiii for this, as he may now see the notification among a flood. Also @amangoel185 and @LovelyBuggies. |
Beta Was this translation helpful? Give feedback.
-
Here's a quick demo. It's just a normal animated Matplotlib plot, and you can get the data for it with import random
import hist
import matplotlib.pyplot as plt
h = hist.Hist.new.Reg(10,0,1).Double()
out = h.plot()
steps = out[0][0]
plt.ion()
plt.show()
for _ in range(100):
h.fill(random.gauss(.5, .25))
values = h.values()
steps.set_data(values)
plt.ylim(0, values.max()*1.1)
plt.pause(.01) |
Beta Was this translation helpful? Give feedback.
Here's a quick demo. It's just a normal animated Matplotlib plot, and you can get the data for it with
.values()
.