py4py.plot ========== .. py:module:: py4py.plot .. autoapi-nested-parse:: Functions designed for plotting output files .. autoapisummary:: py4py.plot.plot_spec py4py.plot.plot_dat py4py.plot.plot_dat_many Module Contents --------------- .. py:function:: plot_spec(col: str, spectra: List[astropy.table.Table], names: List[str], log_x: bool = False, log_y: bool = False, scale_to: Optional[float] = None, lim_x: Optional[Tuple[float, float]] = None) -> matplotlib.figure.Figure Plots an array of python spectra imported as Tables. .. rubric:: Example To plot the 40* viewing angle of two spectra:: plot_spec('A40P0.50', [spec_r01, spec_r10], ['1x', '10x']) :param col: The column in the Astropy Table containing the spectra to plot. :param spectra: The list of Astropy Tables containing spectra to plot. :param names: The list of names of the spectra for the key. :param log_x: Whether the x-axis should be logarithmic or not. :param log_y: Whether the y-axis should be logarithmic or not. :param scale_to: Whether to rescale the plot to normalise to a wavelength. :param lim_x: If provided, the lower and upper bounds for the x-axis. :returns: The generated figure. .. py:function:: plot_dat(table: astropy.table.Table, grid_x: numpy.typing.NDArray[numpy.floating], grid_z: numpy.typing.NDArray[numpy.floating], title: str, label: str, volume: bool = True) Plots a given `py_wind` `.dat` file for a wind property. .. rubric:: Example To plot the H-I fraction of a model:: plot_dat( table_h1_r01, x_r01, z_r01, 'H-I, radius 1x', 'Log ion fraction', volume=False ) :param table: The Astropy Table containing the output of `py_wind` for a property. :param grid_x: The bounds of the X grid for the model. :param grid_z: The bounds of the Z grid for the model. :param title: The title of the plot. :param label: The colour bar label. :param volume: Whether to correct the value to be per-volume considering the model grid. :returns: The generated figure. .. py:function:: plot_dat_many(tables: List[astropy.table.Table], grids_x: List[numpy.typing.NDArray[numpy.floating]], grids_z: List[numpy.typing.NDArray[numpy.floating]], x_lims: List[Tuple[float, float]], z_lims: List[Tuple[float, float]], titles: List[str], title: str, label: str, shared_y: bool = False, shared_cbar: bool = False, volume: bool = True, log: bool = True) Plots multiple `py_wind` `.dat` files of a wind property for multiple models. Example:: To plot the H-I fraction of multiple models:: plot_dat_many( [table_h1_r01, table_h1_r10, table_h1_r30], [x_r01, x_r10, x_r30], [z_r01, z_r10, z_r30], x_lims=[(14.5, 17.5), (15.5, 17.5), (16, 17.5)], z_lims=[(13, 17), (13, 17), (13, 17)], titles=['1x Radius', '10x Radius', '30x Radius'], title='H-I ion fraction', label='Log ion fraction', shared_y=True, volume=False, shared_cbar=True ) :param tables: The Astropy Tables containing the outputs of `py_wind` for a property. :param grids_x: The bounds of the X grid for each model. :param grids_z: The bounds of the Z grid for each model. :param x_lims: The lower and upper ranges of the x-axis for each subplot. :param z_lims: The lower and upper ranges of the z-axis for each subplot. :param titles: The titles of the subplots. :param title: The title of the plot. :param label: The colour bar label. :param shared_y: Whether the plots should share Y-axes. :param shared_cbar: Whether the plots should share the colour bar. :param volume: Whether to correct the value to be per-volume considering the model grid. :param log: Whether the colour scale should be logarithmic or not. :returns: The generated figure.