Many thanks to everyone who send me comments & suggestions. Unfortunately, I did not get what I was hoping for.
The two suggestions to output root histograms in TikZ format, and use a different program, like PGFPlots would probably have worked, but completely negates the benefits of an integrated environment.
Axelâs suggestion, that I copy a widely used style from an experiment is a great one, but if I had a style to copy, I wouldnât have been posting. It would be really really great if the ROOT developers provided a simple example.
The pointers to specific commands were not needed; I already knew the commands, but am unable to find a decent way to deal with the interactions. Two specific examples:
What is the relationship between pad size and axis/title label font. After defining a canvas with a single pad;
TCanvas *c1 = new TCanvas(âFig 3â,âRapidity plotsâ,400,300);
I define and draw a histogram:
TH1D *ALICE6080rap = new TH1D("ALICE6080rap","",50,-10.,10.);
ALICE6080centraltrackcutsee ->Draw(âfsrap>>ALICE6080rapâ);
define the labels
ALICE6080rap->GetXaxis()->SetTitle(âPair Rapidityâ);
ALICE6080rap->GetYaxis()->SetTitle(âd#sigma/dy (mb)â);
I then try to adjust the axis title and label font sizes:
ALICE6080rap->GetXaxis()->SetLabelSize( 0.05);
ALICE6080rap->GetYaxis()->SetLabelSize( 0.05);
ALICE6080rap->GetXaxis()->SetTitleSize( 0.05);
ALICE6080rap->GetYaxis()->SetTitleSize( 0.05);
and then I draw it
ALICE6080rap->Draw();
This produces axis labels that are (just barely) acceptable; the bottom of the âyâ in the x axis label is just barely cut off. Anther plot, with the same format has a subscript âTâ which is also barely cut off, by a different amount when I look at the plot on-screen rather than embedding it in a .tex file.
If I could, I would have made the axis titles a bit larger. But then, depending on where I positioned them, the x axis components would be either cut off below, or overlapped with the axis labels. If I moved the x axis label up, it would overlap with the plot,etc. I could probably figure out how to move the plot upward a bit, but is way too much trial and error. Is this really how a plotting package is supposed to work?
Unfortunately, the problem got worse when I made a canvas with two panels, one atop the other.
TCanvas *c1 = new TCanvas(âFig 2â,âptsq plotsâ,400,600);
c1->Divide(1,2);
c1->cd(1);
STAR6080ptsq->GetXaxis()->SetTitle(âp_{T}^{2} (GeV/c)^{2}â);
STAR6080ptsq->GetXaxis()->SetTitleOffset(0.9);
STAR6080ptsq->GetXaxis()->SetLabelSize( 0.05);
STAR6080ptsq->GetYaxis()->SetLabelSize( 0.05);
STAR6080ptsq->GetXaxis()->SetTitleSize( 0.05);
STAR6080ptsq->GetYaxis()->SetTitleSize( 0.05);
STAR6080ptsq->GetYaxis()->SetTitle(âNumber/binâ);
STAR6080ptsq->GetXaxis()->SetNdivisions(504);
Then, the same title sizes produced noticeably smaller labels, even though the pad was twice as large as before. The Title Offset above was also needed to minimize the overlap/bottom getting cut off.
If anyone wants to see the results, they are the plots in arXiv:arXiv:1801.04320. The issues with the font sizes for single vs. double panel plots are obvious there.
If anybody can point me to working examples like this, I would be grateful.
Thanks again.
Spencer