madgui.plot.twissfigure module

Utilities to create a plot of some TWISS parameter along the accelerator s-axis.

Functions

plot_curve(axes, data, x_name, y_name, style)

Plot a TWISS parameter curve model into a 2D figure.

plot_element_indicators(ax, elements[, …])

Plot element indicators, i.e.

plot_element_indicator(ax, elem[, …])

Return the element type name used for properties like coloring.

plot_constraint(ax, scene, constraint)

Draw one constraint representation in the graph.

plot_selection_marker(ax, model, el_idx[, …])

In-figure markers for active/selected elements.

plot_curves(ax, data, style, label, names)

draw_patch(ax, position, length, style)

ax_label(label, unit)

indicator_params(elem)

Return the parameters used by plot_element_indicator.

madgui.plot.twissfigure.ax_label(label, unit)[source]
madgui.plot.twissfigure.draw_patch(ax, position, length, style)[source]
madgui.plot.twissfigure.indicator_params(elem)[source]

Return the parameters used by plot_element_indicator. This is useful for caching a reduced set of parameters that is faster to compare for changes.

madgui.plot.twissfigure.plot_constraint(ax, scene, constraint)[source]

Draw one constraint representation in the graph.

madgui.plot.twissfigure.plot_curve(axes, data, x_name, y_name, style, label=None)[source]

Plot a TWISS parameter curve model into a 2D figure.

madgui.plot.twissfigure.plot_curves(ax, data, style, label, names)[source]
madgui.plot.twissfigure.plot_element_indicator(ax, elem, elem_styles={'hkicker': {'color': '#bb0088', 'ymax': 0.8, 'ymin': 0.2}, 'hmonitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'monitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'multipole': {'color': '#00aa00', 'ymax': 0.9, 'ymin': 0.1}, 'quadrupole': {'ymax': 0.7, 'ymin': 0.3}, 'sbend': {'color': '#ccccaa', 'ymax': 0.75, 'ymin': 0.25}, 'solenoid': {'color': '#555555', 'ymax': 0.9, 'ymin': 0.1}, 'srotation': {'alpha': 1, 'color': '#000000', 'linestyle': 'solid', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'vkicker': {'color': '#8800bb', 'ymax': 0.8, 'ymin': 0.2}, 'vmonitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}}, default_style=None, effects=None, **defaults)[source]

Return the element type name used for properties like coloring.

madgui.plot.twissfigure.plot_element_indicators(ax, elements, elem_styles={'hkicker': {'color': '#bb0088', 'ymax': 0.8, 'ymin': 0.2}, 'hmonitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'monitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'multipole': {'color': '#00aa00', 'ymax': 0.9, 'ymin': 0.1}, 'quadrupole': {'ymax': 0.7, 'ymin': 0.3}, 'sbend': {'color': '#ccccaa', 'ymax': 0.75, 'ymin': 0.25}, 'solenoid': {'color': '#555555', 'ymax': 0.9, 'ymin': 0.1}, 'srotation': {'alpha': 1, 'color': '#000000', 'linestyle': 'solid', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'vkicker': {'color': '#8800bb', 'ymax': 0.8, 'ymin': 0.2}, 'vmonitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}}, default_style=None, effects=None, **defaults)[source]

Plot element indicators, i.e. create lattice layout plot.

madgui.plot.twissfigure.plot_selection_marker(ax, model, el_idx, elem_styles={'hkicker': {'color': '#bb0088', 'ymax': 0.8, 'ymin': 0.2}, 'hmonitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'monitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'multipole': {'color': '#00aa00', 'ymax': 0.9, 'ymin': 0.1}, 'quadrupole': {'ymax': 0.7, 'ymin': 0.3}, 'sbend': {'color': '#ccccaa', 'ymax': 0.75, 'ymin': 0.25}, 'solenoid': {'color': '#555555', 'ymax': 0.9, 'ymin': 0.1}, 'srotation': {'alpha': 1, 'color': '#000000', 'linestyle': 'solid', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}, 'vkicker': {'color': '#8800bb', 'ymax': 0.8, 'ymin': 0.2}, 'vmonitor': {'color': '#00bb00', 'linestyle': 'dashed', 'linewidth': 1, 'ymax': 1.0, 'ymin': 0.0}}, highlight=True)[source]

In-figure markers for active/selected elements.