File: time_update.py

package info (click to toggle)
wxmplot 0.9.58-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,052 kB
  • sloc: python: 10,085; makefile: 88; sh: 2
file content (18 lines) | stat: -rw-r--r-- 380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python

import time
from datetime import datetime
import numpy as np
from wxmplot import PlotApp


npts = 725
y = np.arange(npts) + np.random.normal(scale=3., size=npts)
t0  = time.time() - 700

t = np.array([datetime.fromtimestamp(t0 + i) for i in range(npts)])

app = PlotApp()
app.plot(t, y, use_dates=True,  marker='+')
app.set_title('Time series data:')
app.run()