Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
matplotlib-doc-zh
提交
edfc3f70
M
matplotlib-doc-zh
项目概览
OpenDocCN
/
matplotlib-doc-zh
9 个月 前同步成功
通知
0
Star
192
Fork
111
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
matplotlib-doc-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
edfc3f70
编写于
1月 07, 2017
作者:
W
wizardforcel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
1a986c56
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
6 deletion
+6
-6
3.1.md
3.1.md
+6
-6
未找到文件。
3.1.md
浏览文件 @
edfc3f70
...
@@ -224,7 +224,7 @@ t = plt.xlabel('my data', fontsize=14, color='red')
...
@@ -224,7 +224,7 @@ t = plt.xlabel('my data', fontsize=14, color='red')
plt
.
title
(
r
'$\sigma_i=15$'
)
plt
.
title
(
r
'$\sigma_i=15$'
)
```
```
标题字符串之前的
`r`
很重要 - 它表示该字符串是一个原始字符串,而不是将反斜杠作为 python 转义处理。
`matplotlib`
有一个内置的 TeX 表达式解析器和布局引擎,并且自带了自己的数学字体 - 详细信息请参阅
[
编写数学表达式
](
http://matplotlib.org/users/mathtext.html#mathtext-tutorial
)
。 因此,你可以跨平台使用数学文本,而无需安装 TeX。 对于安装了 LaTeX 和
`dvipng`
的用户,还可以使用 LaTeX 格式化文本,并将输出直接合并到显示图像或保存的 postscrip
t
中 - 请参阅
[
使用 LaTeX 进行文本渲染
](
http://matplotlib.org/users/usetex.html#usetex-tutorial
)
。
标题字符串之前的
`r`
很重要 - 它表示该字符串是一个原始字符串,而不是将反斜杠作为 python 转义处理。
`matplotlib`
有一个内置的 TeX 表达式解析器和布局引擎,并且自带了自己的数学字体 - 详细信息请参阅
[
编写数学表达式
](
http://matplotlib.org/users/mathtext.html#mathtext-tutorial
)
。 因此,你可以跨平台使用数学文本,而无需安装 TeX。 对于安装了 LaTeX 和
`dvipng`
的用户,还可以使用 LaTeX 格式化文本,并将输出直接合并到显示图像或保存的 postscrip
t
中 - 请参阅
[
使用 LaTeX 进行文本渲染
](
http://matplotlib.org/users/usetex.html#usetex-tutorial
)
。
## 标注文本
## 标注文本
...
@@ -240,7 +240,7 @@ plt.title(r'$\sigma_i=15$')
...
@@ -240,7 +240,7 @@ plt.title(r'$\sigma_i=15$')
`matplotlib.pyplot`
不仅支持线性轴刻度,还支持对数和对数刻度。 如果数据跨越许多数量级,通常会使用它。 更改轴的刻度很容易:
`matplotlib.pyplot`
不仅支持线性轴刻度,还支持对数和对数刻度。 如果数据跨越许多数量级,通常会使用它。 更改轴的刻度很容易:
```
py
```
py
plt
.
xscale
(
‘
log
’
)
plt
.
xscale
(
'log'
)
```
```
下面示例显示了四个图,具有相同数据和不同刻度的
`y`
轴。
下面示例显示了四个图,具有相同数据和不同刻度的
`y`
轴。
...
@@ -255,10 +255,10 @@ y = y[(y > 0) & (y < 1)]
...
@@ -255,10 +255,10 @@ y = y[(y > 0) & (y < 1)]
y
.
sort
()
y
.
sort
()
x
=
np
.
arange
(
len
(
y
))
x
=
np
.
arange
(
len
(
y
))
#
plot with various axes scales
#
带有多个轴刻度的 plot
plt
.
figure
(
1
)
plt
.
figure
(
1
)
#
linear
#
线性
plt
.
subplot
(
221
)
plt
.
subplot
(
221
)
plt
.
plot
(
x
,
y
)
plt
.
plot
(
x
,
y
)
plt
.
yscale
(
'linear'
)
plt
.
yscale
(
'linear'
)
...
@@ -266,7 +266,7 @@ plt.title('linear')
...
@@ -266,7 +266,7 @@ plt.title('linear')
plt
.
grid
(
True
)
plt
.
grid
(
True
)
#
log
#
对数
plt
.
subplot
(
222
)
plt
.
subplot
(
222
)
plt
.
plot
(
x
,
y
)
plt
.
plot
(
x
,
y
)
plt
.
yscale
(
'log'
)
plt
.
yscale
(
'log'
)
...
@@ -274,7 +274,7 @@ plt.title('log')
...
@@ -274,7 +274,7 @@ plt.title('log')
plt
.
grid
(
True
)
plt
.
grid
(
True
)
#
symmetric log
#
对称的对数
plt
.
subplot
(
223
)
plt
.
subplot
(
223
)
plt
.
plot
(
x
,
y
-
y
.
mean
())
plt
.
plot
(
x
,
y
-
y
.
mean
())
plt
.
yscale
(
'symlog'
,
linthreshy
=
0.05
)
plt
.
yscale
(
'symlog'
,
linthreshy
=
0.05
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录