2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

とりあえずヒストグラムを作る(matplotlib)

Last updated at Posted at 2013-10-28
7.3762191e-01
6.9414645e-01
7.2935387e-01
7.2315696e-01
6.9948782e-01
7.0568515e-01
...

こんな感じのデータがあるとする

import numpy
from matplotlib import pyplot


def show(filename):
    data = numpy.loadtxt(filename)
    pyplot.hist(data)
    pyplot.show()

ファイルに保存する場合は

def show(filename):
    data = numpy.loadtxt(filename)
    pyplot.hist(data)
    pyplot.savefig("figure1.eps")

のようにする。
拡張子を自動判定してeps/png等で保存してくれる。
binは自動で判定してくれる。
詳しい指定の仕方は下記リンク参照。

参考文献

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?