Exemplo n.º 1
0
    def __init__(self, style: SchedStyle):
        """Create new figure.

        Args:
            style: Style sheet for pulse schedule visualization.
        """
        self.style = style or SchedStyle()
Exemplo n.º 2
0
    def __init__(self, style):
        """Create new figure.

        Args:
            style (SchedStyle): style sheet
        """
        self.style = style or SchedStyle()
Exemplo n.º 3
0
    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()
Exemplo n.º 4
0
    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()
Exemplo n.º 5
0
    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()