Skip to content

Supports custom plots in live window

Valentin Valls requested to merge custom-plot-in-live-view into master

Closes #3666 (closed)

This PR allow to create a custom plot inside the live window.

This is handled by a in_live_window extra parameter during the creation of the plot.

  • None the default (the plot is automatically allocated, if there was a dedicated container in the live window, it will use it)
  • True, create the plot in the live window
  • False, create the plot in a dedicated tab, like before (BLISS <= 1.10)

Any custom plot can be also moved manually after the creation of the plot. It is then possible to move a plot to the live window, of to move back a custom plot from the live window to the a dedicated tab.

In the live window, a custom plot is stored in a dedicated holder. This holder can remains without the plot, and be saved together with the workspace. As result the regulation plot can be located by default in the live window, if this was setup properly by the users.

Regulation plot

Here is the regulation plot displayed in the live window.

There was no need to update the code of the plot itself to switch it there.

Screenshot_from_2023-02-03_18-23-54

Another random plot

f = flint()
import numpy
t = numpy.linspace(-3, 3, 50)
x = 16 * numpy.sin(t)**3
y = 13 * numpy.cos(t) - 5 * numpy.cos(2*t) - 2 * numpy.cos(3*t) - numpy.cos(4*t)
p = f.get_plot("curve", unique_name="foobar", in_live_window=True)
p.add_curve(x, y, legend="heart")
Edited by Valentin Valls

Merge request reports