[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/users/../examples/api/unicode_minus.html [Back]  [Original]

api example code: unicode_minus.py — Matplotlib 2.0.2 documentation
You are reading an old version of the documentation (v2.0.2). For the latest version see https://matplotlib.org/stable/
forkme_right_orange_ff7600.png [forkme_right_orange_ff7600.png]
matplotlib [matplotlib]
depsy_badge.svg [depsy_badge.svg]
Travis-CI: matplotlib.svg [matplotlib.svg]

This Page

api example code: unicode_minus.py

(Source code, png, pdf)

"""
=============
Unicode minus
=============

You can use the proper typesetting Unicode minus (see
https://en.wikipedia.org/wiki/Plus_sign#Plus_sign) 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

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')
plt.show()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)


Web Proxy Viewer  |  New URL  |  Original Page