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

# qiskit.visualization.plot\_bloch\_vector

`qiskit.visualization.plot_bloch_vector(bloch, title='', ax=None, figsize=None, coord_type='cartesian', font_size=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/visualization/state_visualization.py#L188-L256)

Plot the Bloch sphere.

Plot a Bloch sphere with the specified coordinates, that can be given in both cartesian and spherical systems.

**Parameters**

- **bloch** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*float*](https://docs.python.org/3/library/functions.html#float)*,* [*float*](https://docs.python.org/3/library/functions.html#float)*,* [*float*](https://docs.python.org/3/library/functions.html#float)*]*) – tuple of three elements where (\<x>, \<y>, \<z>) (Cartesian) or (\<r>, \<theta>, \<phi>) (spherical in radians) \<theta> is inclination angle from +z direction \<phi> is azimuth from +x direction
- **title** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – a string that represents the plot title
- **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.11.1)")) – An Axes to use for rendering the bloch sphere
- **figsize** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)) – Figure size in inches. Has no effect if passing `ax`.
- **coord\_type** (*Literal\["cartesian", "spherical"]*) – Either `"cartesian"` or `"spherical"` depending on whether the input is given in Cartesian or spherical coordinates.
- **font\_size** ([*float*](https://docs.python.org/3/library/functions.html#float)) – Font size.

**Returns**

A matplotlib figure instance if `ax = None`.

**Return type**

[`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.11.1)")

**Raises**

[**MissingOptionalLibraryError**](/docs/api/qiskit/exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – Requires matplotlib.

**Examples**

```python
from qiskit.visualization import plot_bloch_vector

plot_bloch_vector([0,1,0], title="New Bloch Sphere")
```

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

```python
import numpy as np
from qiskit.visualization import plot_bloch_vector

# You can use spherical coordinates instead of cartesian.

plot_bloch_vector([1, np.pi/2, np.pi/3], coord_type='spherical')
```

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