I have a TH2 plot and would like to specify only one point on the histogram,
This is what I tried but point didn’t print on the histogram.
tfile->GetObject("h2_alphabo10", h2_alphabo10);//get histogram from file
//plot on the same canvas
const int n = 1;
Double_t alpha = -0.051;
Double_t board = 40.863;
TGraph *g = new TGraph(n,board,alpha);
Can kindly assist me?
It is much simpler:
auto h2 = new TH2F("h2","h2",10,-10,10,10,-10,10);
auto m = new TMarker(-6,0,20);
Thank you. The fill(0.,0.), will it print the histogram on the canvas? And why did you use auto? I am getting the histogram from a file.
So just use TMarker rather than TGraph?
The first 3 lines are just an example to make a plot … I do not have your data…
The important bit is:
auto m = new TMarker(xpos, ypos, 20);
Thank you so much. It worked well.