I would like to draw in one Canvas many graphs (lets say 15), but I don’t want to type for every graph the command
TGraph *gr1 = …
The data for each graph are held by an array[i=15][j=200]. So I would like for each i to draw a graph in the same Canvas. Is there a way to name the pointer (gr) differently for each graph using a loop??
Hello! I have the same situation. In my program I have to analyse 1000 files and access a branch from the tree and execute some code. In the end I have to represent the results in a histogram wich have to contain the data from all the 1000 files. The problem is that the program overwrites the same canvas until the last one.
Also it seems that hit is drawn in the method Paint() but it looks declared elsewhere in your code. Is it global ?
When you draw hit with the option hist it will overwrite the previous plots. If you want to have several histograms drawing on the same plot you should use the option same or use a THStack which might be better if you have 1000 histograms in order to compute the global range.
Note: I have re-formatted your post. It was impossible to see relay the code.