gsplot.figure.show#

Functions

show([fname, ft_list, dpi, show])

A convenience function to save and optionally display a Matplotlib figure.

show(fname='gsplot', ft_list=['png', 'pdf'], dpi=600, show=True, *args, **kwargs)[source]#

A convenience function to save and optionally display a Matplotlib figure.

This function wraps the Show class for easier access and management of figure saving and displaying.

Parameters:
  • fname (str, optional) – The base name for saved figure files (default is “gsplot”).

  • ft_list (list of str, optional) – A list of file formats for saving the figure (default is [“png”, “pdf”]).

  • dpi (float, optional) – The resolution (dots per inch) for saving the figure (default is 600).

  • show (bool, optional) – Whether to display the figure (default is True).

  • *args (Any) – Additional positional arguments passed to plt.savefig.

  • **kwargs (Any) – Additional keyword arguments passed to plt.savefig.

Notes

This function utilizes the ParamsGetter to retrieve bound parameters and the CreateClassParams class to handle the merging of default, configuration, and passed parameters.

Examples

>>> import gsplot as gs
>>> gs.show(fname="example", ft_list=["png", "jpg"], dpi=300, show=True)