graphinglib.Figure#
- class graphinglib.Figure(x_label: str | None = None, y_label: str | None = None, size: tuple[float, float] | Inherit = Inherit, title: str | None = None, x_lim: tuple[float, float] | None = None, y_lim: tuple[float, float] | None = None, log_scale_x: bool | Inherit = Inherit, log_scale_y: bool | Inherit = Inherit, remove_axes: bool = False, aspect_ratio: float | str = 'auto', figure_style: str | Inherit = Inherit)[source]#
This class implements a general figure object.
- Parameters:
- x_label, y_labelstr
The indentification for the x-axis and y-axis. Defaults to
"x axis"and"y axis".- x_lim, y_limtuple[float, float], optional
The limits for the x-axis and y-axis.
- sizetuple[float, float]
Overall size of the figure. Figure size is in inches; typical width is
4to12and typical height is3to8. Default depends on thefigure_styleconfiguration.- title: str, optional
The title of the figure.
- log_scale_x, log_scale_ybool
Whether or not to set the scale of the x- or y-axis to logaritmic scale. Default depends on the
figure_styleconfiguration.- show_gridbool
Whether or not to show the grid. Default depends on the
figure_styleconfiguration.- remove_axesbool
Whether or not to show the axes. Useful for adding tables or text to the subfigure. Defaults to
False.- aspect_ratiofloat, str
The aspect ratio of the axis scaling. Values are
"equal","auto", or a positive float. Defaults to"auto".- figure_stylestr
The figure style to use for the figure.
Methods
__init__([x_label, y_label, size, title, ...])This class implements a general figure object.
add_elements(*elements)Adds one or more
Plottableelements to theFigure.copy()Returns a deep copy of the
Figureobject.copy_with(**kwargs)Returns a deep copy of the Figure with specified attributes overridden.
create_twin_axis([is_y, label, log_scale, ...])Creates a twin axis for the
Figureobject.save(file_name[, legend, legend_loc, ...])Saves the
Figure.set_grid([visible_x, visible_y, which_x, ...])Sets the grid parameters for the figure.
set_rc_params([rc_params_dict, reset])Customize the visual style of the
Figure.set_ticks([xticks, xticklabels, ...])Sets custom ticks and ticks labels.
set_visual_params([reset, ...])Customize the visual style of the
Figure.show([legend, legend_loc, legend_cols])Displays the
Figure.