コード例 #1
0
    def __init__(self, style: SchedStyle):
        """Create new figure.

        Args:
            style: Style sheet for pulse schedule visualization.
        """
        self.style = style or SchedStyle()
コード例 #2
0
ファイル: matplotlib.py プロジェクト: reTELEport/qiskit-terra
    def __init__(self, style):
        """Create new figure.

        Args:
            style (SchedStyle): style sheet
        """
        self.style = style or SchedStyle()
コード例 #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()
コード例 #4
0
ファイル: matplotlib.py プロジェクト: su-yiting/qiskit-terra
    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()
コード例 #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()