py21cmfast.plotting =================== .. py:module:: py21cmfast.plotting .. autoapi-nested-parse:: Simple plotting functions for 21cmFAST objects. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: py21cmfast.plotting.eor_colour py21cmfast.plotting.logger Functions --------- .. autoapisummary:: py21cmfast.plotting.coeval_sliceplot py21cmfast.plotting.lightcone_sliceplot py21cmfast.plotting.plot_global_history Module Contents --------------- .. py:function:: coeval_sliceplot(struct, kind = None, cbar_label = None, **kwargs) Show a slice of a given coeval box. :Parameters: * **struct** (:class:`~outputs._OutputStruct` or :class:`~wrapper.Coeval` instance) -- The output of a function such as `ionize_box` (a class containing several quantities), or `run_coeval`. * **kind** (*str or nd-array*) -- If str: The quantity within the structure to be shown. A full list of available options can be obtained by running ``Coeval.get_fields()``. If nd-array: A 3D box to be shown. This could be useful for plotting the coeval brightness temperature box after redshift space distortions have been applied. * **cbar_label** (*str, optional*) -- A label for the colorbar. Some values of `kind` will have automatically chosen labels, but these can be turned off by setting ``cbar_label=''``. :returns: *fig, ax* -- figure and axis objects from matplotlib :Other Parameters: * **All other parameters are passed directly to :func:`_imshow_slice`. These include `slice_axis`** * **and `slice_index`,** * **which choose the actual slice to plot, optional `fig` and `ax` keywords which enable** * **over-plotting previous figures,** * **and the `imshow_kw` argument, which allows arbitrary styling of the plot.** .. !! processed by numpydoc !! .. py:function:: lightcone_sliceplot(lightcone, kind = 'brightness_temp', lightcone2 = None, vertical = False, xlabel = None, ylabel = None, cbar_label = None, zticks = 'redshift', fig = None, ax = None, z_range=None, **kwargs) Create a 2D plot of a slice through a lightcone. :Parameters: * **lightcone** (:class:`~py21cmfast.wrapper.Lightcone`) -- The lightcone object to plot * **kind** (*str, optional*) -- The attribute of the lightcone to plot. Must be an array. * **lightcone2** (*str, optional*) -- If provided, plot the _difference_ of the selected attribute between the two lightcones. * **vertical** (*bool, optional*) -- Whether to plot the redshift in the vertical direction. * **cbar_label** (*str, optional*) -- A label for the colorbar. Some quantities have automatically chosen labels, but these can be removed by setting `cbar_label=''`. * **zticks** (*str, optional*) -- Defines the co-ordinates of the ticks along the redshift axis. Can be "redshift" (default), "frequency", "distance" (which starts at zero for the lowest redshift) or the name of any function in an astropy cosmology that is purely a function of redshift. * **kwargs** -- Passed through to ``imshow()``. :returns: * *fig* -- The matplotlib Figure object * *ax* -- The matplotlib Axis object onto which the plot was drawn. .. !! processed by numpydoc !! .. py:function:: plot_global_history(lightcone, kind = None, ylabel = None, ylog = False, ax = None, zmax = None, **kwargs) Plot the global history of a given quantity from a lightcone. :Parameters: * **lightcone** (:class:`~LightCone` instance) -- The lightcone containing the quantity to plot. * **kind** (*str, optional*) -- The quantity to plot. Must be in the `global_quantities` dict in the lightcone. By default, will choose the first entry in the dict. * **ylabel** (*str, optional*) -- A y-label for the plot. If None, will use ``kind``. * **ax** (*Axes, optional*) -- The matplotlib Axes object on which to plot. Otherwise, created. .. !! processed by numpydoc !! .. py:data:: eor_colour .. py:data:: logger