I would like to plot a TGraphError object, the first time with all the data and the second time on a zoomed region, I was thinking to use just like TH1 the XAxis options but it’s not working :
Thanks for the hlep, I followed your instruction but had the following resutls :
ROOT-ine.cxx: In function ‘TCanvas* Make_lla(TH1D*, std::vector<TH1D*, std::allocator<TH1D*> >, double*, std::string*)’:
ROOT-ine.cxx:1801: error: invalid conversion from ‘TObject*’ to ‘TGraphErrors*’
What Isent you was an example macro running in interactive mode using CINT. Of course if you include that piece of code in a compiled program (or if you use ru it using AClic) you should add all the needed include files.
Indeed I use this bit of code in a compiled program but I took care to put all the *.h i need, here is the list :
// C++ headers
# include <iostream>
# include <cmath>
# include <fstream>
# include <sstream>
# include <iomanip>
using namespace std ;
// ROOT headers
# include "TROOT.h"
# include "TApplication.h"
# include "TFile.h"
# include "TCanvas.h"
# include "TH1.h"
# include "TF1.h"
# include "TGraph.h"
# include "TGraphErrors.h"
# include "TLegend.h"
# include "TPaveText.h"
# include "TStyle.h"
# include "TLine.h"
Tell me which one was missing to use your method. Anyway the stuff I wrote works nicely.
Sure, no problem. But then you should declare the new graph as mentionned in my last post. As I said, as CINT is more fexible, it allows the kind of construct I first sent, but compilers don’t. Therefore you should do the cast as shown in my last post.
Ok then, thanks for tip.
By the way any idea how to change the style of the font for the axis for a TGraphErrors object, apparently it does not work just like for the TH1.