def __init__(self, style: SchedStyle): """Create new figure. Args: style: Style sheet for pulse schedule visualization. """ self.style = style or SchedStyle()
def __init__(self, style): """Create new figure. Args: style (SchedStyle): style sheet """ self.style = style or SchedStyle()
def __init__(self, style: SchedStyle): """Create new figure. Args: style: Style sheet for pulse schedule visualization. Raises: MissingOptionalLibraryError: If matplotlib is not installed """ from matplotlib import pyplot as plt from matplotlib import gridspec self.plt_mod = plt self.gridspec_mod = gridspec self.style = style or SchedStyle()
def __init__(self, style: SchedStyle): """Create new figure. Args: style: Style sheet for pulse schedule visualization. Raises: ImportError: If matplotlib is not installed """ if not HAS_MATPLOTLIB: raise ImportError("Matplotlib needs to be installed to use " "ScheduleDrawer. It can be installed with " "'pip install matplotlib'") from matplotlib import pyplot as plt self.plt_mod = plt from matplotlib import gridspec self.gridspec_mod = gridspec self.style = style or SchedStyle()
def __init__(self, style: SchedStyle): """Create new figure. Args: style: Style sheet for pulse schedule visualization. Raises: MissingOptionalLibraryError: If matplotlib is not installed """ if not HAS_MATPLOTLIB: raise MissingOptionalLibraryError( libname="Matplotlib", name="ScheduleDrawer", pip_install="pip install matplotlib", ) from matplotlib import pyplot as plt self.plt_mod = plt from matplotlib import gridspec self.gridspec_mod = gridspec self.style = style or SchedStyle()