crested.pl.render_plot#
- crested.pl.render_plot(fig, axs, title=None, suptitle=None, xlabel=None, ylabel=None, supxlabel=None, supylabel=None, xlim=None, ylim=None, grid=False, tight_layout=False, tight_rect=None, suptitle_align=True, title_fontsize=16, suptitle_fontsize=18, xlabel_fontsize=14, ylabel_fontsize=14, supxlabel_fontsize=16, supylabel_fontsize=16, xtick_fontsize=12, ytick_fontsize=12, xtick_rotation=0.0, ytick_rotation=0.0, xtick_ha=None, ytick_va=None, xtick_rotationmode=None, ytick_rotationmode=None, show=True, save_path=None, x_label_fontsize='deprecated', y_label_fontsize='deprecated', x_tick_fontsize='deprecated', y_tick_fontsize='deprecated', x_label_rotation='deprecated', y_label_rotation='deprecated', xlabel_rotation='deprecated', ylabel_rotation='deprecated')#
Render a plot with customization options.
Note
This function should never be called directly. Rather, the other plotting functions call this function.
- Parameters:
fig (
Figure) – The figure object to render.axs (
Axes|list[Axes]) – The axis object or list of axis objects to render.title (
str|list[str] |None(default:None)) – Axis-level title of the plot. If a list, matched to each axis in axs; if a string, applied to all axes.xlabel (
str|list[str] |None(default:None)) – Label for the X-axis. If a list, matched to each axis in axs; if a string, applied to all axes.ylabel (
str|list[str] |None(default:None)) – Label for the Y-axis. If a list, matched to each axis in axs; if a string, applied to all axes.supxlabel (
str|None(default:None)) – Suplabel for the X-axis.supylabel (
str|None(default:None)) – Suplabel for the Y-axis.xlim (tuple[float, float] | list[tuple(float, float)] | None (default:
None)) – X-axis limits. If a list of lists, matched to each axis in axs; if a single list, applied to all axes.ylim (tuple[float, float] | list[tuple(float, float)] | None (default:
None)) – Y-axis limits. If a list of lists, matched to each axis in axs; if a single list, applied to all axes.grid (
bool|Literal['x','y','both'] (default:False)) – Add a major tick grid. True/’both’ for a full grid, ‘x’ or ‘y’ for a specific axis, or False to disable.tight_layout (
bool(default:False)) – Whether to runfig.tight_layout()after setting all plot properties. Default is False; constrained layout throughplt.subplots(layout='constrained')is preferred.tight_rect (
tuple|None(default:None)) – Normalized coordinates in which subplots will fit, forfig.tight_layout(tight_rect=tight_rect). Only does something iftight_layoutis True.suptitle_align (
bool(default:True)) – Whether to manually try and align suptitles closer to the axis titles.title_fontsize (
int(default:16)) – Font size for the title.xlabel_fontsize (
int(default:14)) – Font size for the X-axis labels.ylabel_fontsize (
int(default:14)) – Font size for the Y-axis labels.xtick_fontsize (
int(default:12)) – Font size for the X-axis tick labels.ytick_fontsize (
int(default:12)) – Font size for the Y-axis tick labels.xtick_rotation (
float(default:0.0)) – Rotation of the X-axis labels in degrees.ytick_rotation (
float(default:0.0)) – Rotation of the Y-axis labels in degrees.xtick_ha (
Literal['left','center','right'] |None(default:None)) – Horizontal alignment of the X-axis tick labels. If None, inferred to be appropriate for xtick_rotation.ytick_va (
Literal['baseline','bottom','center','center_baseline','top'] |None(default:None)) – Vertical alignment of the Y-axis tick labels. If None, kept unchanged.xtick_rotationmode (
Literal['default','anchor'] |None(default:None)) – Rotation mode when rotating the X-axis tick labels. If None, inferred to be appropriate for xtick_rotation.ytick_rotationmode (
Literal['default','anchor'] |None(default:None)) – Rotation mode when rotating the Y-axis tick labels. If None, kept unchanged.show (
bool(default:True)) – Whether to display the plot. Set this to False if you want to return the figure object to customize it further.save_path (
str|None(default:None)) – Optional path to save the figure. If None, the figure is displayed but not saved.x_label_fontsize (default:
'deprecated') – Renamed arguments. Please use theirxlabel_*orylabel_*versions instead. Forx/y_label_rotation, renamed to[x/y]tick_rotation.y_label_fontsize (default:
'deprecated') – Renamed arguments. Please use theirxlabel_*orylabel_*versions instead. Forx/y_label_rotation, renamed to[x/y]tick_rotation.x_tick_fontsize (default:
'deprecated') – Renamed arguments. Please use theirxlabel_*orylabel_*versions instead. Forx/y_label_rotation, renamed to[x/y]tick_rotation.y_tick_fontsize (default:
'deprecated') – Renamed arguments. Please use theirxlabel_*orylabel_*versions instead. Forx/y_label_rotation, renamed to[x/y]tick_rotation.x_label_rotation (default:
'deprecated') – Renamed arguments. Please use theirxlabel_*orylabel_*versions instead. Forx/y_label_rotation, renamed to[x/y]tick_rotation.y_label_rotation (default:
'deprecated') – Renamed arguments. Please use theirxlabel_*orylabel_*versions instead. Forx/y_label_rotation, renamed to[x/y]tick_rotation.
- Return type:
None | (plt.Figure, plt.Axis) | (plt.Figure, list[plt.Axis])