Commit bf22660a authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

support log scale in templates

parent 78cdce00
Pipeline #439223 passed with stage
in 4 minutes and 28 seconds
......@@ -828,14 +828,16 @@ class NDScope(*load_ui('scope.ui')):
self.remove_plot(p, _force=True)
def add_plot(p):
log_scale = p.get('log-scale')
t_cursors = p.get('t-cursors')
y_cursors = p.get('y-cursors')
for key in ['t-cursors', 'y-cursors']:
for key in ['log-scale', 't-cursors', 'y-cursors']:
del p[key]
except KeyError:
plot = self.add_plot(**p)
if t_cursors:
if y_cursors:
......@@ -1626,6 +1628,8 @@ class NDScope(*load_ui('scope.ui')):
# convert to float from numpy.float64
plot_item['yrange'] = list(map(float, plot.vb.viewRange()[1]))
if plot.log_mode:
plot_item['log-scale'] = True
if plot.t_cursors.are_visible():
plot_item['t-cursors'] = plot.t_cursors.export()
if plot.y_cursors.are_visible():
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment