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:wantto7 [GiriWiki]

ユーザ用ツール

サイト用ツール


ja:root:wantto7

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



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

===== 軸のラベルをtextにする ====== ---- === 元のラベルを飛ばして、手動でtextを配置する方法 === <code cpp> hist->GetXaxis()->SetLabelOffset(100); // 範囲外へ元の数字のラベルを飛ばしてしまう hist->GetXaxis()->SetNdivisions(3,1,1); TLatex *label = new TLatex(); label->SetTextSize(0.07); label->DrawLatexNDC(0.18,0.04,"K_{L}#rightarrow3#pi^{0}");// TLatexでtextを書いていく label->DrawLatexNDC(0.45,0.04,"K_{L}#rightarrow2#pi^{0}"); label->DrawLatexNDC(0.72,0.04,"K_{L}#rightarrow2#gamma"); </code> === SetBinLabel functionを使う方法 === <code cpp> hist->GetXaxis()->SetBinLabel(1,"K_{L}#rightarrow3#pi^{0}");//第一引数はibin hist->GetXaxis()->SetBinLabel(2,"K_{L}#rightarrow2#pi^{0}");// ibin=0 はunderflow hist->GetXaxis()->SetBinLabel(3,"K_{L}#rightarrow2#gamma"); // ibin=nbin+1 はoverflow を表す hist->GetXaxis()->SetLabelSize(0.07); </code> === TPad::DrawFrame を使った場合 === DrawFrame functionで生成されるhistogramは、実はnbin=1000をもつ。 必要なbin数にまでrebinしてまとめてやった上でSetBinLabelを呼べば良い。 <code cpp> const Int_t NLabel = 3; const TString LabelText[NLabel] = { "K_{L}#rightarrow3#pi^{0}", "K_{L}#rightarrow2#pi^{0}", "K_{L}#rightarrow2#gamma" }; TCanvas *c = new TCanvas("c","c",700,500); TH1F *frame = (TH1F*)c->DrawFrame(0,3,3,4.5); frame->GetXaxis()->SetNdivisions(NLabel,1,1,false); frame->Rebin( frame->GetNbinsX()/NLabel ); for(Int_t i = 0 ; i < NLabel ; ++i) frame->GetXaxis()->SetBinLabel(i+1,LabelText[i]); frame->GetXaxis()->SetLabelSize(0.07); </code> ----

ja/root/wantto7.1534954807.txt.gz · 最終更新: 2018/08/22 16:20 by kota