Hey guys,
I’m writing my thesis at the moment and would like to draw some plots. I’m using c++11 and since I’m not a big fan of the pointer management with TCanvas, I’m trying to write a little wrapper class:
What are the options you pass to AddGraph? If you are repeatedly passing "A" then a new axis is drawn for every plot and the previous one will not be visible.
You could also have the canvas divided and a pad for each graph be generated:
As an aside, I would recommend looking at exporting your data to something like pgfplots (TikZ). These make very nice figures and have the benefit of being tied directly to the data. The text rendering is down right in LaTeX and matches the rest of the document, the scaling of text is correct and not distorted. You can quickly go back to a plot you generated months ago and change the appearance without recalling the details of the complicated analysis that generated said figure. (Alternatively, be sure to save ROOT files with the figures so that simple changes can easily be made later.) This is a personal preference. There are some ways to do this semi automatically.
Yes, I was passing A every time, and I changed it to only the first graph passing “A”. Now it draws 2 of the three lines, but only the first axis is drawn and this hides part of the 2nd line. So I need to check the bounds of all the TGraphs before and set them manually. Which function in TCanvas sets the bounds?
I wanted all the graphs to be in the same plot, because they represent the same data.
Can’t I save the Canvases in .root files and manually adjust them later?
Thanks a lot!