I would like to know how to write the coordinates of the points I want to plot to a dat file in advance and use that file to generate a graph in TH2D.
In the case of tgraph2d, I can plot the points written to the dat file with the following macro, but I could not do it with TH2D.
{
auto g = new TGraph2D("exm.dat");
g->Draw("p0");
}