Skip to content

Real time data plotting. Update continuously. #595

Closed Answered by henryiii
ayanb07 asked this question in Q&A
Discussion options

You must be logged in to vote

Here's a quick demo. It's just a normal animated Matplotlib plot, and you can get the data for it with .values().

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)

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@ayanb07
Comment options

@eduardo-rodrigues
Comment options

@henryiii
Comment options

@ayanb07
Comment options

Answer selected by ayanb07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants