I want to change the line width of my histograms. When I do this
TStyle gStyle;
gStyle.SetHistLineWidth(5);
and then create, fill and draw some histograms, the line width does not change, but instead my 2D histograms suddenly have a quite ugly color palette. How can I (globally) change the line width for my TH1Ds ?
This might work in the console, or in a script (actually I get an error “Symbol hpx is not defined”), but when I want to compile the code, I have no idea how to do it.
I tried this:
include "TH1D.h"
#include "TCanvas.h"
#include "TROOT.h"
#include "TStyle.h"
void test () {
TROOT* troot = new TROOT();
troot->ForceStyle();
TStyle* tstyle = new TStyle();
tstyle->SetHistLineWidth(6);
TH1D* h = new TH1D("","",100,0,100);
for (int i=0;i<100;i++){h->SetBinContent(i+1,i);}
TCanvas* c = new TCanvas();
h->Draw();
}
but changing the histLineWidth seems to have no effect.