ZgoubidooMatplotlibArtist

class zgoubidoo.vis.ZgoubidooMatplotlibArtist(ax=None, with_boxes: bool = True, with_frames: bool = True, with_centers: bool = False, tracks_color: str = 'b', **kwargs)[source]

Bases: georges_core.vis.matplotlib.MatplotlibArtist

A matplotlib implementation of a ZgoubiPlot artist.

Parameters
  • ax (param) – the matplotlib ax used for plotting. If None it will be created with init_plot (kwargs are

  • forwarded)

  • with_boxes – draw the body of each elements

  • with_frames – draw the entry and exit frames of each elements

  • with_centers – draw the center of each polar coordinate elements

  • tracks_color – color for the plotting of tracks

  • kwargs – forwarded to ZgoubiPlot and to init_plot.

Attributes Summary

ax

Current Matplotlib ax.

ax2

Returns:

figure

Current Matplotlib figure.

tracks_color

The color for the rendering of the tracks.

Methods Summary

cartesianmagnet(magnet[, apertures])

Rendering of magnets in cartesian coordinates.

cartouche_cartesianmagnet(s_location, magnet)

param s_location

cartouche_cavite(s_location, cavite)

param s_location

cartouche_drift(s_location, magnet)

param s_location

cartouche_quadrupole(s_location, magnet)

param s_location

cartouche_solenoid(s_location, magnet)

param s_location

init_plot([figsize, subplots])

Initialize the Matplotlib figure and ax.

plot(*args, **kwargs)

Proxy for matplotlib.pyplot.plot

polarmagnet(magnet)

Rendering of magnets in polar coordinates.

tracks_cartesianmagnet(magnet, tracks)

Plot tracks for a cartesian magnet.

tracks_polarmagnet(magnet, tracks)

Plot tracks for a polar magnet.

Attributes Documentation

ax

Current Matplotlib ax.

Returns

the Matplotlib ax.

ax2

Returns:

figure

Current Matplotlib figure.

Returns

the Matplotlib figure.

tracks_color

The color for the rendering of the tracks.

Returns

color as a string

Methods Documentation

cartesianmagnet(magnet: zgoubidoo.commands.magnetique.CartesianMagnet, apertures: bool = False)[source]

Rendering of magnets in cartesian coordinates.

Plot magnets in cartesian coordinates using rectangles.

Parameters
  • magnet – the magnet to be rendered.

  • apertures

cartouche_cartesianmagnet(s_location, magnet: zgoubidoo.commands.magnetique.CartesianMagnet)[source]
Parameters
  • s_location

  • magnet

Returns:

cartouche_cavite(s_location, cavite: zgoubidoo.commands.electrique.Cavite)[source]
Parameters
  • s_location

  • cavite

Returns:

cartouche_drift(s_location, magnet: zgoubidoo.commands.magnetique.CartesianMagnet)[source]
Parameters
  • s_location

  • magnet

Returns:

cartouche_quadrupole(s_location, magnet: zgoubidoo.commands.magnetique.CartesianMagnet)[source]
Parameters
  • s_location

  • magnet

Returns:

cartouche_solenoid(s_location, magnet: zgoubidoo.commands.magnetique.CartesianMagnet)[source]
Parameters
  • s_location

  • magnet

Returns:

init_plot(figsize=12, 8, subplots=111)[source]

Initialize the Matplotlib figure and ax.

Parameters
  • subplots – number of subplots

  • figsize – figure size

plot(*args, **kwargs)[source]

Proxy for matplotlib.pyplot.plot

Same as matplotlib.pyplot.plot, forwards all arguments.

polarmagnet(magnet: zgoubidoo.commands.magnetique.PolarMagnet)[source]

Rendering of magnets in polar coordinates.

Plot magnets in polar coordinates using wedges.

Parameters

magnet – the magnet to be rendered.

tracks_cartesianmagnet(magnet: zgoubidoo.commands.magnetique.CartesianMagnet, tracks: pandas.core.frame.DataFrame)[source]

Plot tracks for a cartesian magnet.

Parameters
  • magnet – the magnet to which the tracks are attached

  • tracks – a dataframe containing the tracks

tracks_polarmagnet(magnet: zgoubidoo.commands.magnetique.PolarMagnet, tracks)[source]

Plot tracks for a polar magnet.

Parameters
  • magnet – the magnet to which the tracks are attached

  • tracks – a dataframe containing the tracks