Dears,
I have a problem to plot a graph using the log scale. In particular, the axis titles disappear when I set the log scale (if I remove the log scale they work properly).
Following the piece of code:
gPad.SetGrid()
canvas.SetTopMargin(.08)
canvas.SetRightMargin(0.05)
canvas.SetBottomMargin(0.13)
canvas.SetLeftMargin(0.16)
canvas.SetBorderSize(2)
canvas.SetFrameFillStyle(0);
canvas.SetFrameBorderMode(0);
canvas.SetFrameFillStyle(0);
canvas.SetFrameBorderMode(0);
canvas.Update()
gr = TGraph( "data.csv", "%lg %lg")
gr.SetMarkerStyle(8)
gr.SetMarkerSize(1.6)
gr.SetMarkerColor(4)
gr.SetLineColor(4)
gr.Draw( 'AP' )
##############
canvas.Update()
gr.GetXaxis().SetTitle("X")
gr.GetYaxis().SetTitle("Y")
gr.GetXaxis().SetTitleFont(43)
gr.GetYaxis().SetTitleFont(43)
gr.GetXaxis().SetTitleSize(25)
gr.GetYaxis().SetTitleSize(25)
gr.GetXaxis().SetTitleOffset(1)
gr.GetYaxis().SetTitleOffset(1.4)
gr.GetXaxis().SetLimits(0,5000)
gr.SetMinimum(0)
gr.SetMaximum(1000)
gr.GetXaxis().SetLabelFont(43)
gr.GetYaxis().SetLabelFont(43)
gr.GetXaxis().SetLabelSize(22)
gr.GetYaxis().SetLabelSize(22)
gr.GetXaxis().SetLabelOffset(0.005)
gr.GetYaxis().SetLabelOffset(.015)
#gr.GetXaxis().SetNdivisions(20,5,0)
## Disable stats
ROOT.gROOT.SetBatch()
ROOT.gStyle.SetOptStat(0)
ROOT.gStyle.SetOptTitle(0)
canvas.SetLogx()
#canvas.SetLogy()
canvas.Update()
Where am I wrong?
thanks in advance