scistag.plotstag.matplot_helper.MPHelper

class MPHelper[source]

Bases: object

Provides some basic helper functions for integrating matplotlib into scistag such as converting figures to Images.

Methods

figure_to_image

Converts a figure to an Image object

figure_to_png

Converts a figure to a png byte stream

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

classmethod figure_to_image(figure, transparent=True)[source]

Converts a figure to an Image object

Parameters
  • figure – The figure to be converted

  • transparent – Defines if the figure shall be transparent

Return type

Image

Returns

The byte stream

static figure_to_png(figure, transparent=True)[source]

Converts a figure to a png byte stream

Parameters
  • figure – The figure to be converted

  • transparent – Defines if the figure shall be transparent

Return type

bytes

Returns

The byte stream