scistag.plotstag.matplot_lock.MPLock

class MPLock(backend='Agg')[source]

Bases: object

Helper class to make matplotlib usable in a multi-threaded environment.

Usage:

with MPLock() as plt:
    plt.imshow(..)
Parameters

backend – The backend to be used. Background rendering by default

Methods

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

access_lock

Shared access lock to prevent multiple thread using Matplotlib at the same time

backend

The backend to be used

pl

Link to the module once valid

access_lock = <scistag.common.mt.stag_lock.StagLock object>

Shared access lock to prevent multiple thread using Matplotlib at the same time

backend: str | None

The backend to be used

pl

Link to the module once valid