Skip to main contentIBM Quantum Documentation
Qiskit IBM Provider is deprecated. See the migration guide to use Qiskit Runtime.


iplot_gate_map(backend, figsize=(None, None), label_qubits=True, qubit_size=None, line_width=None, font_size=None, qubit_color='#2f4b7c', qubit_labels=None, line_color='#2f4b7c', font_color='white', background_color='white', as_widget=False)

GitHub(opens in a new tab)

Plots an interactive gate map of a device.


  • backend (IBMBackend) – Plot the gate map for this backend.
  • figsize (Tuple[Optional[int], Optional[int]]) – Output figure size (wxh) in inches.
  • label_qubits (bool) – Labels for the qubits.
  • qubit_size (Optional[float]) – Size of qubit marker.
  • line_width (Optional[float]) – Width of lines.
  • font_size (Optional[int]) – Font size of qubit labels.
  • qubit_color (Union[List[str], str]) – A list of colors for the qubits. If a single color is given, it’s used for all qubits.
  • qubit_labels (Optional[List[str]]) – A list of qubit labels
  • line_color (Union[List[str], str]) – A list of colors for each line from the coupling map. If a single color is given, it’s used for all lines.
  • font_color (str) – The font color for the qubit labels.
  • background_color (str) – The background color, either ‘white’ or ‘black’.
  • as_widget (bool) – True if the figure is to be returned as a PlotlyWidget. Otherwise the figure is to be returned as a PlotlyFigure.

Return type

Union[PlotlyFigure, PlotlyWidget]


The gate map figure.


from qiskit_ibm_provider.test.ibm_provider_mock import mock_get_backend
# Generate a mock provider for the sake of this example.
# This line will allow the mocked ``IBMProvider`` to return
# a fake backend in the following cell.
 from qiskit_ibm_provider import IBMProvider
 from qiskit_ibm_provider.visualization import iplot_gate_map
provider = IBMProvider(group='open', project='main')
# Note that this is a mock provider, replace ``FakeOpenPulse2Q``
# with any of the currently available IBM devices.
backend = provider.get_backend('FakeOpenPulse2Q')
 iplot_gate_map(backend, as_widget=True)
Was this page helpful?
Report a bug or request content on GitHub.