Plot Styler API
- class pynamicalsys.core.plot_styler.PlotStyler(fontsize: int = 20, legend_fontsize: int = 14, axes_linewidth: float = 1.3, font_family: str = 'STIXGeneral', tick_direction_in: bool = True, minor_ticks_visible: bool = False, linewidth: float = 1.0, markersize: float = 5.0, markeredgewidth: float = 1.0, markeredgecolor: str = 'black', ticks_on_all_sides: bool = True)[source]
Bases:
objectA utility class to globally configure and apply consistent styling for Matplotlib plots.
This class sets default plot aesthetics such as font sizes, line widths, marker styles, tick behavior, and more, using Matplotlib’s rcParams. It ensures consistent visual style across multiple figures and subplots with minimal repetitive code.
Parameters
- fontsizeint, default=20
Base font size for labels, titles, and text.
- legend_fontsizeint, default=14
Font size for the legend.
- axes_linewidthfloat, default=1.3
Width of the axes borders.
- font_familystr, default=”STIXGeneral”
Font family used for text and math rendering.
- line_widthfloat, default=2.0
Default line width for plot lines.
- markersizefloat, default=6.0
Default marker size for lines with markers.
- markeredgewidthfloat, default=1.0
Edge width for plot markers.
- markeredgecolorstr, default=”black”
Edge color for plot markers.
- tick_direction_inbool, default=True
Whether ticks point inward (True) or outward (False).
- minor_ticks_visiblebool, default=True
Whether minor ticks are visible.
Methods
- apply_style()
Applies the defined styling parameters globally using Matplotlib’s rcParams.
- set_tick_padding(ax, pad_x=None, pad_y=None)
Sets custom padding between axis ticks and labels for a given Axes object.