alpaca.plotting
Functions
- alpaca.plotting.check_plotting_engines()
Check the availability of plotting engines.
Returns
- available (dict)
A dictionary with the availability status of each plotting engine.
- alpaca.plotting.mpl.exclusionplot(x: Container[float] | Axis, y: Container[float] | Axis, chi2: list[ChiSquared] | ChiSquared, xlabel: str | None = None, ylabel: str | None = None, title: str | None = None, ax: Axes | None = None, global_chi2: ChiSquared | bool = True, logo_position=0) Axes
Create a static exclusion plot.
Parameters
- xContainer[float] | Axis
The x-coordinates of the data points.
- yContainer[float] | Axis
The y-coordinates of the data points.
- chi2list[ChiSquared] | ChiSquared
The ChiSquared object(s) representing the exclusion regions. If a single ChiSquared object is provided, it will be treated as the global exclusion significance.
- xlabelstr | None, optional
The label for the x-axis.
- ylabelstr | None, optional
The label for the y-axis.
- titlestr | None, optional
The title of the plot (default is None).
- axplt.Axes | None, optional
The matplotlib Axes object to plot on (default is None, which creates a new figure).
- global_chi2ChiSquared | bool, optional
A ChiSquared object representing the global exclusion significance (default is True, which uses the combined chi squared). If set to False, no global significance will be plotted.
- logo_positionint | str | None, optional
- The location of the ALP-aca logo on the plot (default is 0, which corresponds to the upper right corner). Valid values are:
0 or ‘best’: avoids legend
1 or ‘upper right’: upper right corner
2 or ‘upper left’: upper left corner
3 or ‘lower left’: lower left corner
4 or ‘lower right’: lower right corner
None: no logo will be added
- alpaca.plotting.mpl.alp_channels_plot(x: Container[float] | Axis, channels: dict[str, Container[float]], xlabel: str | None = None, ylabel: str | None = None, ymin: float | None = None, title: str | None = None, ax: Axes | None = None, logo_position=0) Axes
Create a static plot for ALP decay channels.
Parameters
- xContainer[float] | Axis
The x-coordinates of the data points.
- channelsdict[str, Container[float]]
A dictionary where keys are channel names and values are the corresponding y-coordinates.
- xlabelstr | None, optional
The label for the x-axis.
- ylabelstr | None, optional
The label for the y-axis.
- yminfloat
The minimum value for the y-axis.
- titlestr | None, optional
The title of the plot (default is None).
- axplt.Axes | None, optional
The matplotlib Axes object to plot on (default is None, which creates a new figure).
- logo_positionint | str | None, optional
- The location of the ALP-aca logo on the plot (default is 0, which corresponds to the upper right corner). Valid values are:
0 or ‘best’: avoids legend
1 or ‘upper right’: upper right corner
2 or ‘upper left’: upper left corner
3 or ‘lower left’: lower left corner
4 or ‘lower right’: lower right corner
None: no logo will be added
- alpaca.plotting.plotly.exclusionplot(x: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Axis, y: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Axis, chi2: list[ChiSquared] | ChiSquared, xlabel: str | None = None, ylabel: str | None = None, title: str | None = None, fig: Figure | None = None, global_chi2: ChiSquared | bool = True, xvar: str | None = None, yvar: str | None = None, xunits: str | None = None, yunits: str | None = None, logo_position: int | str | None = 0) Figure
Create an interactive exclusion plot.
Parameters
- xnp.typing.ArrayLike | Axis
The x-coordinates of the data points.
- ynp.typing.ArrayLike | Axis
The y-coordinates of the data points.
- chi2list[ChiSquared] | ChiSquared
The ChiSquared object(s) representing the exclusion regions. If a single ChiSquared object is provided, it will be treated as the global exclusion significance.
- xlabelstr | None, optional
The label for the x-axis.
- ylabelstr | None, optional
The label for the y-axis.
- titlestr | None, optional
The title of the plot (default is None).
- figgo.Figure | None, optional
The Plotly Figure object to plot on (default is None, which creates a new figure).
- global_chi2ChiSquared | bool, optional
A ChiSquared object representing the global exclusion significance (default is True, which uses the combined chi squared). If set to False, no global significance will be plotted.
- xvarstr | None, optional
The variable name for the x-axis when hovering over the plot (default is None, which uses the Axis name if available). Formatting with HTML is supported.
- yvarstr | None, optional
The variable name for the y-axis when hovering over the plot (default is None, which uses the Axis name if available). Formatting with HTML is supported.
- xunitsstr | None, optional
The units for the x-axis when hovering over the plot (default is None, which uses the Axis units if available). Formatting with HTML is supported.
- yunitsstr | None, optional
The units for the y-axis when hovering over the plot (default is None, which uses the Axis units if available). Formatting with HTML is supported.
- logo_positionint | str | None, optional
- The location of the ALP-aca logo on the plot (default is 0, which corresponds to the upper right corner). Valid values are:
0 or ‘upper right’: upper right corner
1 or ‘upper right’: upper right corner
2 or ‘upper left’: upper left corner
3 or ‘lower left’: lower left corner
4 or ‘lower right’: lower right corner
None: no logo will be added
- alpaca.plotting.plotly.alp_channels_plot(x: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Axis, channels: dict[str, Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]], xlabel: str | None = None, ylabel: str | None = None, ymin: float | None = None, title: str | None = None, fig: Figure | None = None, xvar: str | None = None, yvar: str = 'y', xunits: str | None = None, yunits: str = '', logo_position: int | str | None = 0) Figure
Create an interactive plot for ALP decay channels.
Parameters
- xnp.typing.ArrayLike | Axis
The x-coordinates of the data points.
- channelsdict[str, np.typing.ArrayLike]
A dictionary where keys are channel names and values are the corresponding y-coordinates.
- xlabelstr | None, optional
The label for the x-axis.
- ylabelstr | None, optional
The label for the y-axis.
- yminfloat
The minimum value for the y-axis.
- titlestr | None, optional
The title of the plot (default is None).
- figgo.Figure | None, optional
The Plotly Figure object to plot on (default is None, which creates a new figure).
- xvarstr | None, optional
The variable name for the x-axis when hovering over the plot (default is None, which uses the Axis name if available). Formatting with HTML is supported.
- yvarstr, optional
The variable name for the y-axis when hovering over the plot (default is ‘y’). Formatting with HTML is supported.
- xunitsstr | None, optional
The units for the x-axis when hovering over the plot (default is None, which uses the Axis units if available). Formatting with HTML is supported.
- yunitsstr, optional
The units for the y-axis when hovering over the plot (default is ‘’). Formatting with HTML is supported.
- logo_positionint | str | None, optional
- The location of the ALP-aca logo on the plot (default is 0, which corresponds to the upper right corner). Valid values are:
0 or ‘upper right’: upper right corner
1 or ‘upper right’: upper right corner
2 or ‘upper left’: upper left corner
3 or ‘lower left’: lower left corner
4 or ‘lower right’: lower right corner
None: no logo will be added
- alpaca.plotting.plotly.save_html(fig: Figure, filename: str, title: str, template: str = 'basic')
Save a Plotly figure as an HTML file using a template.
Parameters
- figgo.Figure
The Plotly Figure object to be saved.
- filenamestr
The path to the output HTML file.
- titlestr
The title of the HTML page.
- templatestr, optional
The name of the HTML template to use (default is ‘basic’).
- alpaca.plotting.plotly.prepare_nb()
Prepare the Jupyter Notebook environment for Plotly plotting.