How to add a histogram and a graph in same canvas

Hello everyone!! I’m trying to add graph and histogram together in a same canvas. Can anyone please help me with it!!

Below I have attached separate graph and histogram macro file. I want a single macro file where I can show both histogram and graph together. Thank you so much in advance. It’ll really help me a lot.

graph.C (286 Bytes)
hist.C (2.7 KB)

Hi,

Just remove “a” option (drawing of axis) from TGraph. Then it will use existing scales for drawing.

See attached macro.
hist_graph.C (2.9 KB)

Regards,
Sergey

1 Like

Thanks a lot Sergey!! It worked

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.