-
最近の投稿
最近のコメント
Archive
カテゴリー
メタ情報
「python」カテゴリーアーカイブ
ROOT のヒストグラムの内容を python のリストとして得る
基本的に ROOT のヒストグラムならROOTの機能 (Draw) で描画して絵を得るのが素直ですが,python の方でいろいろと処理したい場合に便利? ビンの下端の値をリストとして得る [testh.GetBinLo … 続きを読む
カテゴリー: matplotlib, pyROOT, python, ROOT
コメントする
pyROOT tips
Legend の作成
1 2 3 4 5 |
from ROOT import TLegend def setLegend(leg, entries): if isinstance(entries, (list, tuple)): for ent in entries: leg.AddEntry(ent, ent.GetName()) |
使い方
1 2 |
leg = TLegend(0.65, 0.65, 0.85, 0.85) setLegend(leg, (h1, h2, h3)) |
複数のカットを and で連結する [crayon-664 … 続きを読む
pyOpenGL を Windows8 (64bit) にインストールする
環境は OS:Windows8 Pro 64 bit,Python: Python2.7 (64bit) > pip install “pyopengl” pip が使えなければ,PyPI の pyOpenGL の … 続きを読む
Enthought Canopy と Continum Anaconda
科学計算やデータ可視化のための python モジュールをひとまとめにして利用できる便利なパッケージで主なものには Enthought 社の Canopy と Continum 社の Aanconda があるようです.ど … 続きを読む
カテゴリー: data analysis, matplotlib, python
コメントする
matplotlib のプロットの単純な例
matplotlib を用いて関数をプロットする単純な例.
1 2 3 4 5 6 |
import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 10, 0.2) y = np.sin(x) plt.plot(x, y) plt.show() |
さらに簡略化された書き方として,pylab を用いて以下のように書くこともできます.̶ … 続きを読む
カテゴリー: matplotlib, python
コメントする