Hello,
just a simple question. I would like to superimpose two histos.
Actually it is a simple plot showing the wordl map with a satellite orbits. Anyway, the second
histogram should have a different line color but SetLineColor(ROOT.kRed) seems not working.
The code is below:
cart = "/user/root-6.22.02/tutorials/graphics/world.dat"
def world_map(cart):
with open(cart) as f:
for line in f:
line = line.strip()
if not line: # line is blank
continue
else:
vals = line.split()
#print vals[0], vals[1]
world_lat.append(float(vals[0]))
world_lon.append(float(vals[1]))
h_map = TH2F('histo', 'Mini-EUSO shadow orbital position ',360,-180,180,180,-90,90)
for j in range(len(world_lat)):
h_map.Fill(world_lat[j],world_lon[j])
#gStyle.SetOptStat(0)
h_map.Draw("")
h_map.SetDirectory(0)
c1.Update()
histo = TH2F('histo', 'Mini-EUSO shadow orbital position ',360,-180,180,180,-90,90)
for k in range(len(lat)):
histo.Fill(lon[k],lat[k])
histo.GetXaxis().SetTitle("lon [degrees]")
histo.GetYaxis().SetTitle("lat [degrees]")
histo.SetLineColor(ROOT.kRed) #SetLineColor(2)
#gStyle.SetOptStat(0)
histo.Draw("same")
"""
gr = TGraph(len(lat), lon, lat)
c1.cd()
gr.SetMarkerStyle(105)
gr.SetMarkerColor(2)
gr.GetXaxis().SetTitle("lon [degrees]")
gr.GetYaxis().SetTitle("lat [degrees]")
gr.Draw("same")
"""
c1.SaveAs(dir1+"orbital_path_2.png")
all x,y variables are numpy array of floats.
As you could see I tried also making a TGraph() instaed of an histogram but nothing change!
Any advice? And moreover, could you explain why it doesn’t work!
For sure if you have another way which is easier and powerfull I will
listen at it!
Many may thanks in advance
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided