Trying to paint an area of a THStack with a different color

Hi everyone, i made this plot using HStack and now i need to paint the area between the 2 horizontal lines (which are hist too) with a different color just to highlight it, can anyone help me? i attached my macro, the data and the graph that i am getting

gaus.C (8.8 KB) datos2.txt (9.7 KB)

You can make a graph with the 4 corners of the region you want, add a fill to it and draw it on the same pad; something like this:

Your macro has problems:

Processing gaus.C...
Warning in <TROOT::Append>: Replacing existing TH1: asdqw (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: asdqw (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: asdqw (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: asdwe (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: asder (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: asdqw (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: asdwe (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: asder (Potential memory leak).
Error in <TCanvas::Range>: illegal world coordinates range: x1=-4.000000, y1=0.000000, x2=36.000000, y2=0.000000
Error in <TCanvas::RangeAxis>: illegal axis coordinates range: xmin=0.000000, ymin=0.000000, xmax=32.000000, ymax=0.000000

Thank you for taking the time to answer, i thought about making a Graph with an exclusion zone but i don’t know if it’s possible to add a graph to a HStack, i’m going to look at the post you suggest thank you.

Yeah thank you for answering and sorry about the errors, i keep getting those same errors but the plot i want to make is drawn anyway and i’m in a kind of a hurry here so i don’t mind much about those. Do you have any suggestions on my problem?

Thank you both for your help, i ended up remaking all the histos like graphs so i can use the multigraph like @dastudillo suggested.

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