Skip to content

Commit

Permalink
os.mkdir
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiisoup committed Oct 16, 2017
1 parent f4891b1 commit 19cf67e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
7 changes: 0 additions & 7 deletions chapter2/src/tutorial2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ matplotlib パッケージの中の pyplot モジュールを plt という名
@savefig tutorial2_plot1.png width=4in
plt.plot(y)
.. image:: ../../savefig/tutorial2_plot1.png
:width: 4in
:target: ../../savefig/tutorial2_plot1.png
plt.plot の引数に1次元データを渡すことで、
横軸が要素番号、縦軸が要素の値のグラフを描画できる。
Expand All @@ -201,10 +198,6 @@ x軸を指定するには、
@savefig tutorial2_plot2.png width=4in
plt.plot(x, y, '-o')
.. image:: ../../savefig/tutorial2_plot2.png
:width: 4in
:target: ../../savefig/tutorial2_plot2.png

というように、x軸の値とy軸の値を引数として渡す。
なお、3つ目の引数には描画の様式を指定する。ここで、’-o’を渡すと、
丸印のマーカを線で繋いだグラフを描画できる。
5 changes: 0 additions & 5 deletions chapter2/src/tutorial3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,4 @@ Jupyter-notebookなどの開発環境では、
@savefig tutorial3_plot1.png width=4in
plt.plot(x, y)
.. image:: ../../savefig/tutorial3_plot1.png
:width: 4in
:target: ../../savefig/tutorial3_plot1.png


のように、引数にオブジェクトを渡すことで実行できる。
8 changes: 8 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Sometimes the savefig directory doesn't exist and needs to be created
# https://github.com/ipython/ipython/issues/8733
# becomes obsolete when ipython 5.2 is out
import os
ipython_savefig_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'_build','html','_static')
if not os.path.exists(ipython_savefig_dir):
os.makedirs(ipython_savefig_dir)

# -- Options for HTMLHelp output ------------------------------------------

Expand Down

0 comments on commit 19cf67e

Please sign in to comment.