Skip to content

Commit

Permalink
stripchart example uses color-coded y-axes
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Jan 26, 2025
1 parent 284ff83 commit 9a74a41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/stripchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def onStartTimer(self,event=None):
self.tlist = [t0]
self.tmin_last = -10000
self.time0 = time.time()
self.timer.Start(100)
self.timer.Start(50)

def onStopTimer(self,event=None):
self.timer.Stop()
Expand All @@ -133,8 +133,10 @@ def onTimer(self, event):
n = len(self.y1list)

if n <= 2:
self.plotpanel.plot(tdat, y1dat, use_date=True, timezone=TZONE)
self.plotpanel.oplot(tdat, y2dat, yaxes=2, use_dates=True, timezone=TZONE)
self.plotpanel.plot(tdat, y1dat, use_date=True, timezone=TZONE,
xlabel='time', ylabel='Val 1', yaxes_tracecolor=True)
self.plotpanel.oplot(tdat, y2dat, yaxes=2, y2label='Value 2',
use_dates=True, timezone=TZONE)
else:
self.plotpanel.update_line(0, tdat, y1dat, draw=True)
self.plotpanel.update_line(1, tdat, y2dat, draw=True, yaxes=2)
Expand Down

0 comments on commit 9a74a41

Please sign in to comment.