cait.styles

cait.styles.make_grid(ax=None)[source]

Produce the pyplot plot grid that is used within the Cait plotting routines.

Parameters:

ax (object) – A pyplot axis object, optional.

cait.styles.scatter_img(x_data, y_data, height=2800, width=2800, alpha=0.3, xlims=None, ylims=None)[source]

Produce a scatter plot to plot as an image with pyplot.imshow.

Parameters:
  • x_data (1D array) – The values for the x axis.

  • y_data (1D array) – The values for the x axis.

  • height (int) – The number of pixels on the x axis.

  • width (int) – The number of pixels on the y axis.

  • alpha (float) – The occupacity of one event inside a pixel, between 0 and 1.

  • xlims (2-tuple) – The limits on the x axis.

  • ylims (2-tuple) – The limits on the y axis.

Returns:

List of the x limits, the y limits and the density values for the image plot.

Return type:

list of (2-tuple, 2-tuple, 2D matrix)

cait.styles.txt_fmt(text: str, color: str = None, style: str = None)[source]

Format output string with color and style.

Parameters:
  • text (str) – The text to format

  • color (str) – The color to use. Valid options are “purple”, “cyan”, “darkcyan”, “blue”, “green”, “yellow” and “red”.

  • style (str) – Optional. Valid options are “underline” and “bold”.

cait.styles.use_cait_style(x_size=7.2, y_size=4.45, fontsize=18, autolayout=True, dpi=None)[source]

Use the pyplot plot style that is used within the Cait plotting routines.

Parameters:
  • x_size (float) – The width of the plot in cm.

  • y_size (float) – The height of the plot in cm.

  • fontsize (int) – The font size of the plot.

  • autolayout (bool) – Activate autolayout.

  • dpi (int) – The dots per inch for the plot.