If the TGraph is named you can retrieve it with (c1 = pointer to tcanvas):
TGraph * g = (TGraph*)c1->FindObject(name);
(the default name is “Graph”)
(You can give a Graph a name with the SetName(“name”) method)
An array of points in a Graph can be retrieved with GetX() and GetY() and GetN() for the number of points.
You can see what subpads are in a canvas with:
c1->GetListOfPrimitives()->ls()
and retrieve certain objects with:
c1->GetListOfPrimitives()->At(index)