pysolver_view.reporting.style module#
- pysolver_view.reporting.style.print_installed_fonts()[source]#
Print the list of fonts installed on the system.
This function identifies and prints all available fonts for use in Matplotlib.
- pysolver_view.reporting.style.print_rc_parameters(filename=None)[source]#
Print the current rcParams used by Matplotlib or write to file if provided.
This function provides a quick overview of the active configuration parameters within Matplotlib.
- pysolver_view.reporting.style.savefig_in_formats(fig, path_without_extension, formats=['.png', '.svg'], dpi=500)[source]#
Save a given Matplotlib figure in multiple file formats.
- Parameters:
- figmatplotlib.figure.Figure
The figure object to be saved.
- path_without_extensionstr
The full path to save the figure excluding the file extension.
- formatslist of str, optional
A list of string file extensions to specify which formats the figure should be saved in. Supported formats are [‘.png’, ‘.svg’, ‘.pdf’, ‘.eps’]. Default is [‘.png’, ‘.svg’].
- dpiint, optional
The resolution in dots per inch with which to save the image. This parameter affects only PNG files. Default is 500.
Examples
>>> import matplotlib.pyplot as plt >>> fig, ax = plt.subplots() >>> ax.plot([0, 1], [0, 1]) >>> save_fig_in_formats(fig, "/path/to/figure/filename")
This will save the figure as “filename.png”, “filename.svg”, and “filename.pdf” in the “/path/to/figure/” directory.
- pysolver_view.reporting.style.set_plot_options(fontsize=13, grid=False, major_ticks=True, minor_ticks=True, margin=0.05, color_order='matlab', linewidth=1.25)[source]#
Set options for creating publication-quality figures using Matplotlib.
This function updates the internal Matplotlib settings to better align with standards for publication-quality figures. Features include improved font selections, tick marks, grid appearance, and color selections.
- Parameters:
- fontsizeint, optional
Font size for text elements in the plot. Default is 13.
- gridbool, optional
Whether to show grid lines on the plot. Default is True.
- major_ticksbool, optional
Whether to show major ticks. Default is True.
- minor_ticksbool, optional
Whether to show minor ticks. Default is True.
- marginfloat, optional
Margin size for axes. Default is 0.05.
- color_orderstr, optional
Color order to be used for plot lines. Options include “python” and “matlab”. Default is “matlab”.