Deprecated: Array and string offset access syntax with curly braces is deprecated in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/init.php on line 542
ja:root:wantto2 [GiriWiki]

ユーザ用ツール

サイト用ツール


ja:root:wantto2

以前のリビジョンの文書です



Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/handler.php on line 1458

Warning: Declaration of syntax_plugin_note::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line 79

Warning: Declaration of syntax_plugin_note::render($mode, &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line 101

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3120 in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

====== ヒストグラムを規格化(Scale)して、さらにエラーバーをつけたい ====== ---- ===== ヒストグラムを規格化する ===== ===== ヒストグラムにエラーバーをつける ===== ヒストグラムにエラーバーをつけるには、TH1::Draw の"E"オプションを使えば良い。\\ "E"にもいくつかあって、 * "E": 誤差棒( error bars)を描画する。 * "E0": データがないビンを含め、誤差棒を描画する。 * "E1": 誤差棒の端に(誤差棒に対して)垂直な線をつけて描画する。 * "E2": 誤差棒に長方形をつけて描画する。 * "E3": 縦の誤差棒の端点を通るフィル領域を描画する。 * "E4": 誤差棒の端点を通る滑らかなフィル領域を描画する。 とある。"E1"とかを使っておけばOK。小文字でも良い。\\ ただ、"E"オプションを使うと元のヒストグラムの線が表示されないのが難点(一度やってみるとわかる)。\\ なので面倒だが <code c> h->Draw(); h->Draw("same e1"); </code> のようにする。 (ヒストグラムをコピーして片方をエラー用にして、分けた状態で重ね描いても良い)\\ ===== サンプルコード ===== <code c_mac> // マクロ test.C のサンプルコード void test() { TH1D *h1 = new TH1D("h1","h1",100,-10,10); TH1D *h2 = new TH1D("h2","h2",100,-10,10); TCanvas *c = new TCanvas("c","c",700,600); h1->FillRandom("gaus",10000); h2->FillRandom("gaus",1000); TH1D *h1e = (TH1D*)h1->Clone("h1e"); TH1D *h2e = (TH1D*)h2->Clone("h2e"); h2e->Sumw2(); h2->Scale(10); h2e->Scale(10); h1->SetLineColor(2); h2->SetLineColor(4); h1e->SetLineColor(2); h2e->SetLineColor(4); h1->Draw(); h1e->Draw("same e1"); h2->Draw("same"); h2e->Draw("same e1"); gPad->Modified(); //いらんと思うけど一応入れた gPad->Update(); } </code>

ja/root/wantto2.1422530864.txt.gz · 最終更新: 2015/01/29 11:27 by kota