Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
d2l-zh
提交
c626de1d
D
d2l-zh
项目概览
OpenDocCN
/
d2l-zh
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
d2l-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c626de1d
编写于
8月 03, 2018
作者:
A
Aston Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
matplotlib retina to svg
上级
3cf2ef6c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
15 addition
and
11 deletion
+15
-11
Makefile
Makefile
+3
-3
build/ipynb2mdd.sh
build/ipynb2mdd.sh
+8
-2
chapter_deep-learning-basics/linear-regression-scratch.md
chapter_deep-learning-basics/linear-regression-scratch.md
+1
-1
chapter_deep-learning-basics/mlp.md
chapter_deep-learning-basics/mlp.md
+1
-1
chapter_deep-learning-basics/weight-decay.md
chapter_deep-learning-basics/weight-decay.md
+1
-1
chapter_optimization/optimization-intro.md
chapter_optimization/optimization-intro.md
+0
-2
gluonbook/utils.py
gluonbook/utils.py
+1
-1
未找到文件。
Makefile
浏览文件 @
c626de1d
...
...
@@ -43,7 +43,7 @@ GIF=$(wildcard img/*.gif)
build/_build/latex/%.pdf
:
img/%.svg
@
mkdir
-p
$
(
@D
)
rsvg-convert
-f
pdf
-o
$@
$<
rsvg-convert
-f
pdf
-
z
0.80
-
o
$@
$<
build/_build/latex/%_00.pdf
:
img/%_00.pdf
@
mkdir
-p
$
(
@D
)
...
...
@@ -55,8 +55,8 @@ PDFIMG = $(patsubst img/%.svg, build/_build/latex/%.pdf, $(SVG)) \
pdf
:
$(DEPS) $(OBJ) $(PDFIMG)
@
echo
$(PDFIMG)
make
-C
build latex
sed
-i
's/\.svg/\.pdf/g'
${TEX}
sed
-i
s/
\}\.
gif/
\_
00
\}
.pdf/g
$(TEX)
sed
-i
s/
\\
.svg/.pdf/g
${TEX}
sed
-i
s/
\}\
\
.gif/
\_
00
\}
.pdf/g
$(TEX)
sed
-i
s/
{
tocdepth
}{
0
}
/
{
tocdepth
}{
1
}
/g
$(TEX)
sed
-i
s/
{
\\\\
releasename
}{
发布
}
/
{
\\\\
releasename
}{}
/g
$(TEX)
sed
-i
s/
{
OriginalVerbatim
}
\\\[
commandchars
=
\\\\\\\\\\\\
{
\\\\
}
\\\]
/
{
OriginalVerbatim
}
\\\[
commandchars
=
\\\\\\\\\\\\
{
\\\\
}
,formatcom
=
\\\\
footnotesize
\\\]
/g
$(TEX)
...
...
build/ipynb2mdd.sh
浏览文件 @
c626de1d
...
...
@@ -29,7 +29,7 @@ for f in $MD/chapter*/*md; do
# Remove inner link.
sed
-i
's/\[\([^]]*\)\]([^\)]*.md)/\1/g'
$f
# Refer pdf instead of svg.
sed
-i
s/
\
.
svg/
\
.
pdf/g
$f
sed
-i
s/
\
\
.svg/
.pdf/g
$f
# Refer img in the same level.
sed
-i
's/\](..\/img/\](img/g'
$f
if
[
"
$f
"
!=
"
$dir
/index.md"
]
;
then
...
...
@@ -39,7 +39,13 @@ done
# Convert svg to pdf.
for
f
in
$MD
/img/
*
svg
;
do
rsvg-convert
-f
pdf
-o
"
${
f
%%.*
}
.pdf"
$f
rsvg-convert
-f
pdf
-z
0.80
-o
"
${
f
%%.*
}
.pdf"
$f
rm
$f
done
# Convert matplotlib-generated svg to pdf.
for
f
in
$MD
/
*
_files/
*
svg
;
do
rsvg-convert
-f
pdf
-z
0.80
-o
"
${
f
%%.*
}
.pdf"
$f
rm
$f
done
...
...
chapter_deep-learning-basics/linear-regression-scratch.md
浏览文件 @
c626de1d
...
...
@@ -40,7 +40,7 @@ features[0], labels[0]
```
{.python .input n=4}
def set_figsize(figsize=(3.5, 2.5)):
set_matplotlib_formats('
retina') # 打印高清
图。
set_matplotlib_formats('
svg') # 打印矢量
图。
plt.rcParams['figure.figsize'] = figsize # 设置图的尺寸。
set_figsize()
...
...
chapter_deep-learning-basics/mlp.md
浏览文件 @
c626de1d
...
...
@@ -52,7 +52,7 @@ import gluonbook as gb
from mxnet import nd
def xyplot(x_vals, y_vals, x_label, y_label):
%config InlineBackend.figure_format = '
retina
'
%config InlineBackend.figure_format = '
svg
'
gb.plt.rcParams['figure.figsize'] = (3.5, 2.5)
gb.plt.plot(x_vals,y_vals)
gb.plt.xlabel(x_label)
...
...
chapter_deep-learning-basics/weight-decay.md
浏览文件 @
c626de1d
...
...
@@ -97,7 +97,7 @@ train_iter = gdata.DataLoader(gdata.ArrayDataset(
net = gb.linreg
loss = gb.squared_loss
%config InlineBackend.figure_format = '
retina
'
%config InlineBackend.figure_format = '
svg
'
gb.plt.rcParams['figure.figsize'] = (3.5, 2.5)
def fit_and_plot(lambd):
...
...
chapter_optimization/optimization-intro.md
浏览文件 @
c626de1d
...
...
@@ -48,8 +48,6 @@ def f(x):
return x * np.cos(np.pi * x)
gb.set_figsize((4.5, 2.5))
gb.set_matplotlib_formats('svg')
x = np.arange(-1.0, 2.0, 0.1)
fig = gb.plt.figure()
subplt = fig.add_subplot(111)
...
...
gluonbook/utils.py
浏览文件 @
c626de1d
...
...
@@ -320,7 +320,7 @@ def semilogy(x_vals, y_vals, x_label, y_label, x2_vals=None, y2_vals=None,
def
set_figsize
(
figsize
=
(
3.5
,
2.5
)):
"""Set matplotlib figure size."""
set_matplotlib_formats
(
'
retina
'
)
set_matplotlib_formats
(
'
svg
'
)
plt
.
rcParams
[
'figure.figsize'
]
=
figsize
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录