0
4

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.

[Pythonによる科学・技術計算] ヒストグラム,可視化,matplotlib

Posted at

matplotlibを用いてヒストグラム(棒グラフ)を作成する。
オプション等についての詳しい説明はここ(英語)にある。


import numpy as np
import matplotlib.pyplot as plt

data_lis=[2.4,5.1,1.0,8.0,12.0,22.0,15.0,9.0,12,19.4,21.2,2.3]# サンプルデータ

fig=plt.figure()
ax=fig.add_subplot(111)

ax.hist(data_lis, range=(0,20),bins=5) # [0,20]の範囲で5等分した棒グラフの作成

plt.show()

###結果
t.png

0
4
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
0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?