fluopy.figure ============= .. py:module:: fluopy.figure .. autoapi-nested-parse:: A universal figure to plot simulation results. A universal figure is defined for plotting simulation results with matplotlib. Functions --------- .. autoapisummary:: fluopy.figure.universal_figure Module Contents --------------- .. py:function:: universal_figure(nrows: int = 1, ncols: int = 1, fig_width: float = 6, fig_height: float = 3, scale: float = 1, rc_linewidth: float = 2, type_: str = 'line', data: numpy.typing.ArrayLike | collections.abc.Sequence[Any] = (0, 0), label: str | collections.abc.Sequence[str] | None = None, color: str | collections.abc.Sequence[str] | collections.abc.Callable[[int]] = 'blue', title: str | None = None, xlabel: str = 'x', ylabel: str = 'y', ylabelcolor: str = 'black', xlim: tuple[float, float] | None = None, ylim: tuple[float, float] | None = None, xscale: str | None = None, yscale: str | None = None, xminor: bool = False, yminor: bool = False, adjust_x: float | None = None, adjust_y: float | None = None, xticks: numpy.typing.ArrayLike | None = None, yticks: numpy.typing.ArrayLike | None = None, xticklabels: dict[str, Any] | None = None, yticklabels: dict[str, Any] | None = None, tick_params: dict[str, Any] | None = None, tick_spacing_x: float | None = None, tick_spacing_y: float | None = None, tick_style_x: str | None = None, tick_style_y: str | None = None, second_axis_x: bool = False, second_axis_y: bool = False, fontsize: float = 21, legend: bool = False, legendhandles: collections.abc.Sequence[Any] | None = None, legendcolor: str = 'black', legendargs: dict[str, Any] | None = None, draw_marker: collections.abc.Sequence[Any] | None = None, draw_marker_param: dict[str, Any] | None = None, plot_distribution: scipy.stats.distributions.rv_frozen | collections.abc.Sequence[scipy.stats.distributions.rv_frozen] | None = None, plot_distribution_label: str | None = None, axes: numpy.typing.NDArray[matplotlib.axes.Axes] | None = None, **type_specific_kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Constructs a figure or modifies axes. :param nrows: Number of rows of plt.subplots. :param ncols: Number of columns of plt.subplots. :param fig_width: Width of the figure. :param fig_height: Height of the figure. :param scale: Factor to scale the figure. :param rc_linewidth: Linewidth of the axes. :param type_: Type of the plot. One of "hist", "multiple_hist", "2d_hist", "bar", "line", "multiple_line", "scatter", "errorbar", "step", "stair", "boxplot". :param data: Data to be plotted. Required formation depends on input parameter type_. :param label: Label to pass to legend. For multiple_line, multiple_hist, and bar, a list of labels. :param color: Color. For multiple_line and multiple_hist, either a callable function or a list of colors. For bar, a color or a list of colors. :param title: The title of the plot. :param xlabel: The label text of the x-axis. :param ylabel: The label text of the y-axis. :param ylabelcolor: The color of the y-axis label. :param xlim: Left and right limit of the x-axis. :param ylim: Lower and upper limit of the y-axis. :param xscale: One of "linear", "log", "symlog", "logit". :param yscale: One of "linear", "log", "symlog", "logit". :param xminor: Whether to plot minor ticks on the x-axis. Only relevant if xscale is log. :param yminor: Whether to plot minor ticks on the y-axis. Only relevant if yscale is log. :param adjust_x: Factor applied to tick label formatter. :param adjust_y: Factor applied to tick label formatter. :param xticks: xtick locations. :param yticks: ytick locations. :param xticklabels: Keyword 'labels' with labels to place at the given tick locations. Keyword 'rotation' to rotate text. :param yticklabels: Keyword 'labels' with labels to place at the given tick locations. Keyword 'rotation' to rotate text. :param tick_params: Parameters to pass to .tick_params(). :param tick_spacing_x: Set a tick on each integer multiple of tick_spacing_x. :param tick_spacing_y: Set a tick on each integer multiple of tick_spacing_y. :param tick_style_x: "sci" - scientific notation. The offset is added to the xlabel. :param tick_style_y: "sci" - scientific notation. The offset is added to the ylabel. :param second_axis_x: Whether to plot a second x-axis. :param second_axis_y: Whether to plot a second y-axis. :param fontsize: Size of font. :param legend: Whether to display a legend. :param legendhandles: If not None, collection of handles (e.g., matplotlib.patches.Patch). :param legendcolor: Color of text in legend. :param legendargs: Additional arguments to pass to legend. :param draw_marker: The data positions, consists of x and y. :param draw_marker_param: Parameters to pass to .scatter. Default is {"marker": "x", "c": "k", "label": "prediction", "s": 100}. :param plot_distribution: Additional distribution to be plotted. For multiple_hist, a list of distributions. :param plot_distribution_label: Label of plot_distribution. For multiple_hist, label is 'pred'. :param axes: Contains matplotlib.axes.Axes objects. If None, a new figure is created. :param type_specific_kwargs: type_ properties :returns: Contains matplotlib.axes.Axes. Shape is (nrows, ncols). :rtype: npt.NDArray[matplotlib.axes.Axes]