---
title: plot_gate_map (latest version)
description: API reference for qiskit.visualization.plot_gate_map in the latest version of qiskit
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.visualization.plot_gate_map
---

# qiskit.visualization.plot\_gate\_map

`qiskit.visualization.plot_gate_map(backend, figsize=None, plot_directed=False, label_qubits=True, qubit_size=None, line_width=4, font_size=None, qubit_color=None, qubit_labels=None, line_color=None, font_color='white', ax=None, filename=None, qubit_coordinates=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/visualization/gate_map.py#L27-L934)

Plots the gate map of a device.

**Parameters**

- **backend** ([*Backend*](/docs/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend")) – The backend instance that will be used to plot the device gate map.
- **figsize** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)) – Output figure size (wxh) in inches.
- **plot\_directed** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – Plot directed coupling map.
- **label\_qubits** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – Label the qubits.
- **qubit\_size** ([*float*](https://docs.python.org/3/library/functions.html#float)) – Size of qubit marker.
- **line\_width** ([*float*](https://docs.python.org/3/library/functions.html#float)) – Width of lines.
- **font\_size** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Font size of qubit labels.
- **qubit\_color** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)) – A list of colors for the qubits
- **qubit\_labels** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)) – A list of qubit labels
- **line\_color** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)) – A list of colors for each line from coupling\_map.
- **font\_color** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – The font color for the qubit labels.
- **ax** (*Axes*) – A Matplotlib axes instance.
- **filename** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – file path to save image to.
- **qubit\_coordinates** (*Sequence*) – An optional sequence input (list or array being the most common) of 2d coordinates for each qubit. The length of the sequence must match the number of qubits on the backend. The sequence should be the planar coordinates in a 0-based square grid where each qubit is located.

**Returns**

A Matplotlib figure instance.

**Return type**

Figure

**Raises**

- [**QiskitError**](/docs/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – If you tried to pass a simulator or the backend is None, but one of num\_qubits, mpl\_data, or cmap is None.
- [**MissingOptionalLibraryError**](/docs/api/qiskit/exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – If matplotlib not installed.

**Example**

```python
from qiskit.providers.fake_provider import GenericBackendV2
from qiskit.visualization import plot_gate_map

backend = GenericBackendV2(num_qubits=5)

plot_gate_map(backend)
```

![Output from the previous code.](https://eu-de.quantum.cloud.ibm.com/docs/images/api/qiskit/qiskit-visualization-plot_gate_map-1.avif)
