Skip to content

Commit 100ccc3

Browse files
authored
Merge pull request #48 from hibtc/matchFeature
Add dynamical color change to snapshots
2 parents ea0ef8e + b1e7963 commit 100ccc3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/madgui/plot/twissfigure.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ select_style:
3636
# ``matplotlib.axes.Axes.plot()``
3737
reference_style:
3838
linestyle: "-"
39-
color: "black"
39+
color: "C0"
40+
alpha: 0.5
4041

4142
# Style for monitor markers:
4243
readouts_style:

src/madgui/widget/curvemanager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def data(self):
6565
return self.curveTable.rows
6666

6767
def on_btn_save(self):
68+
"""
69+
Add a Snapshot of the current twiss figure
70+
"""
6871
scene = self.scene
6972
twiss = scene.model.twiss()
7073
data = {
@@ -75,6 +78,7 @@ def on_btn_save(self):
7578
style = scene.config['reference_style']
7679
scene.snapshot_num += 1
7780
name = "snapshot {}".format(scene.snapshot_num)
81+
style['color'] = 'C{}'.format(scene.snapshot_num)
7882
scene.add_curve(name, data, style)
7983
self.curveTable.edit(
8084
self.curveTable.model().index(len(self.available)-1, 0))

0 commit comments

Comments
 (0)