You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.1.1.post1074+gb67098b
Fork me on GitHub

Related Topics

This Page

Unicode minusΒΆ

You can use the proper typesetting Unicode minus (see or the ASCII hyphen for minus, which some people prefer. The matplotlibrc param axes.unicode_minus controls the default behavior.

The default is to use the Unicode minus.

import numpy as np
import matplotlib
import matplotlib.pyplot as plt

# Fixing random state for reproducibility

matplotlib.rcParams['axes.unicode_minus'] = False
fig, ax = plt.subplots()
ax.plot(10*np.random.randn(100), 10*np.random.randn(100), 'o')
ax.set_title('Using hyphen instead of Unicode minus')

Gallery generated by Sphinx-Gallery