FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/examples/api/unicode_minus.py at master · JoyPoint/matplotlib · GitHub
JoyPoint
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
examples
/
api
/
unicode_minus.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (20 loc) · 671 Bytes
Breadcrumbs
matplotlib
/
examples
/
api
/
unicode_minus.py
Copy path
File metadata and controls
25 lines (20 loc) · 671 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
=============
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
# Fixing random state for reproducibility
np
.
random
.
seed
(
19680801
)
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
()
Back
|
FazBrowse Home
|
New Git URL