graphinglib.Figure#

class graphinglib.Figure(x_label: str | None = None, y_label: str | None = None, size: tuple[float, float] | Literal['default'] = 'default', title: str | None = None, x_lim: tuple[float, float] | None = None, y_lim: tuple[float, float] | None = None, log_scale_x: bool | Literal['default'] = 'default', log_scale_y: bool | Literal['default'] = 'default', show_grid: bool | Literal['default'] = 'default', remove_axes: bool = False, aspect_ratio: float | str = 'auto', figure_style: str = 'default')[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. Default depends on the figure_style configuration.

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_style configuration.

show_gridbool

Whether or not to show the grid. Default depends on the figure_style configuration.

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. Can be either “equal”, “auto” or a 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 Plottable elements to the Figure.

create_twin_axis([is_y, label, log_scale, ...])

Creates a twin axis for the Figure object.

save(file_name[, legend, legend_loc, ...])

Saves the Figure.

set_rc_params([rc_params_dict, reset])

Customize the visual style of the Figure.

set_ticks([xticks, xticklabels, ...])

Sets custom [x/y]ticks and [x/y]ticks' labels.

set_visual_params([reset, ...])

Customize the visual style of the Figure.

show([legend, legend_loc, legend_cols])

Displays the Figure.