Showing real-time data using traces
Code: "canvas2D_hplotrt.py". Programming language: Python
DMelt Version 1. Last modified: 05/19/2016. License: Pro
https://datamelt.org/code/cache/canvas2D_hplotrt_3811.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from jhplot import *
from java.awt import Color
from java.util import Random
from info.monitorenter.gui.chart.traces import Trace2DSimple
import time
trace = Trace2DSimple()
c1 = HPlotRT("Canvas")
trace1 = Trace2DSimple("Trace1")
trace1.setColor(Color.red)
c1.add(trace1)
trace2 = Trace2DSimple("Trace2")
c1.add(trace2)
rand = Random()
for i in range(100):
time.sleep(0.05)
trace1.addPoint(i,rand.nextGaussian())
trace2.addPoint(i, 5+rand.nextGaussian())
You see the box below because you did not login.