Results plotting#

This module uses the georges-core’s plotting module . It can uses the Matplotlib ot the Plotly library as backend.

Example:

import matplotlib.pyplot as plt
plt.rc('text', usetex=False)
fig = plt.figure(figsize=(20,8))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df) # Preparation of the plot
manzoni_plot.plot_beamline(sequence.df, print_label=False, with_aperture=False, plane='X')

If an observer has been used in the simulation, the results can be added to the previous figure depending the instance of the observer:

Type of observers#

Mean Observer#

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df)
manzoni_plot.plot_beamline(sequence.df, print_label=False, with_aperture=True, plane='X')
manzoni_plot.tracking(beam_observer_mean, plane='X')
../_images/visualisation_2_4.png

Std Observer#

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df)
manzoni_plot.plot_beamline(sequence.df, print_label=False, with_aperture=True, plane='X')
manzoni_plot.tracking(beam_observer_std, plane='both')
../_images/visualisation_4_4.png

Beam Observer#

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df)
manzoni_plot.plot_beamline(sequence.df, print_label=False, with_aperture=True, plane='X')
manzoni_plot.tracking(beam_observer_beam, fill_between=False, plane='X', mean=False, std=False, halo=True)
../_images/visualisation_6_4.png

Phase Space Observer#

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df)
manzoni_plot.phase_space(observer=beam_observer_beam,
                         element='Q1',
                         dim=['X', 'PX'],
                         location='OUT',
                         nbins=[51, 51])
../_images/visualisation_8_0.png

Losses Observer#

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df) # Preparation of the plot
manzoni_plot.losses(beam_observer_losses, log_scale=True)
../_images/visualisation_9_0.png

Twiss Observer#

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df)
manzoni_plot.twiss(beam_observer_tw, with_beta=True, with_alpha=False, with_dispersion=False)
../_images/visualisation_11_0.png

Symmetry Observer#

fig = plt.figure(figsize=(10,4))
ax = fig.add_subplot(111)
manzoni_plot = vis.ManzoniMatplotlibArtist(ax=ax)
manzoni_plot.plot_cartouche(sequence.df)
manzoni_plot.symmetry(observer=symmetry_observer)
../_images/visualisation_13_0.png

API#

ManzoniMatplotlibArtist([tracks_color])

A matplotlib implementation of a Matplotlib artist.

ManzoniPlotlyArtist([tracks_color])

A plotly implementation of a Plotly artist.

Inheritance diagram of georges.vis.matplotlib.ManzoniMatplotlibArtist, georges.vis.plotly.ManzoniPlotlyArtist