tardis.visualization.plot_util module

Utility functions to be used in plotting.

tardis.visualization.plot_util.axis_label_in_latex(label_text, unit, only_text=True)[source]

Get axis label for plotly plots that can show units in latex.

Parameters
label_textstr

Text to show on label, may be expressed in latex

unitastropy.units

Unit of the label which needs to be expressed in latex

only_textbool

If label_text is expressed purely in text (i.e. without using latex) or not. Default value is True

Returns
str

Latex string for label renderable by plotly

tardis.visualization.plot_util.get_mid_point_idx(arr)[source]

Get index of the middle point of a sorted array (ascending or descending).

The values in array may not be evenly distributed so it picks the middle point not by index but by their values.

Parameters
arrnp.array
Returns
int