The “save as” root macro ignores several settings, currently I have noticed ROOT.gStyle.SetEndErrorSize()
and ROOT.gStyle.SetHatchesLineWidth()
. It also produces the wrong axis label sizes (one needs to compare carefully, but they are still noticeably different), however this I only observe with a label size of 0.04, if I put 0.05 or 0.03 for example, then the generated macro file produces the right axis label sizes, which is strange.
The images I get with running the script in python, and later doing root test.C
are shown below in the same order. My questions are, do you also observe these problems and are these bugs that can be fixed? There could be some other settings that the save as root macro ignores (some of them I posted about earlier this week, they are now fixed).
import ROOT
ROOT.gStyle.SetEndErrorSize(20)
ROOT.gStyle.SetHatchesLineWidth(4)
graphs = ROOT.TMultiGraph()
canvas = ROOT.TCanvas()
graph = ROOT.TGraphErrors()
graph.SetPoint(0,3,2)
graph.SetPointError(0,0,1)
graph.SetLineWidth(4)
graphs.Add(graph, "p")
graph2 = ROOT.TGraphErrors()
graph2.SetPoint(0,4,2)
graph2.SetPointError(0,0,1)
graph2.SetPoint(1,5,2)
graph2.SetPointError(1,0,1)
graph2.SetFillStyle(3490)
graph2.SetFillColor(ROOT.kRed)
graphs.Add(graph2, "3")
graphs.Draw("A")
axisX, axisY = graphs.GetXaxis(), graphs.GetYaxis()
axisX.SetLimits(2.5,5.5)
axisX.SetLabelSize(0.04)
axisY.SetLabelSize(0.04)
canvas.Modified()
canvas.Update()
canvas.SaveAs("test.png")
canvas.SaveAs("test.C")
ROOT Version: 6.19.01
Platform: Ubuntu 18.04
Compiler: gcc 7.4
Python: 3.6.8