Problem with normal plot (vertical error bars) on root6.10 compared to root5.34

Hi, I just installed (despite me) ROOT 6.10 on my pc. Before, I had a root 5.34. And the problems begin.
I compiled this code.

TH1D* Analyse::ThistoPlot(const char* title, const char* Histo, int bin, int colo, int x_min, int x_max)
	TH1D* histo = new TH1D(Histo, title, bin, x_min, x_max) ;
	histo->GetXaxis()->CenterTitle() ;
	histo->GetYaxis()->CenterTitle() ;
	histo->SetLineColor(colo+1) ;
	histo->SetMarkerSize(7) ;
	histo->SetLineWidth(3) ;
	return histo ;

and then

TH1D* amplitud[4] ;
for(int c = 0 ; c < 4 ; c++){
       amplitud[c] = analyse->ThistoPlot(Form("#bf{max spectrum %d};#bf{Channel number};#bf{Normalized 
       events}",c+1),Form("spectrum%d",c+1),1000, c,0,4000) ;

leg = new TLegend(0.55, 0.75, 0.75, 0.90) ;
C->Clear() ;
gStyle->SetErrorX(0) ;
for(int c = 3 ; c >= 0 ; c--)
		amplitud[c]->Scale(1./amplitud[c]->GetMaximum()) ;
		amplitud[c]->Draw("SAME") ;
		leg->AddEntry(amplitud[c], Form("Amplitude for PM %d", c),"l") ;
		amplitud[c]->Scale(1./amplitud[c]->GetMaximum()) ;
		amplitud[c]->Draw("") ;
		leg->AddEntry(amplitud[c], Form("Amplitude for PM %d", c),"l") ;

On root5, I get this figure:

And on root6 I get this.

In root6 I can get some plot like this :

I would like to get exactly the same thing as on root5 but I do not know what to do. I tried all the Draw view options (“APCL”) but nothing works. I would like to remove this vertical bar and connect my points.

Any help is appreciated.
best regards.

Try: histo_pointer->Draw(“HIST”);

Thanks Wile_E_Coyote for answering to me. But this ( Draw(“HIST”) ) does not change the previous display.

Can you post a small script reproducing the problem ?

I’m sorry Wile_E_Coyote “HIST” option work very well.
But I do not understand. Why this form of TH1 plot ? Why do I automatically have the errors bars without asking nothing ?
Thanks you very well.

The ROOT Team asked for it on your behalf (but in ROOT 6 only).

When an histogram has errors it is visualized by default with error bars. To visualize it without errors use the option “HIST” together with the required option (eg “hist same c”).

See also:

1 Like

Okay. Thank you for everything. I take note.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.