How to put a graph onto a histogram?

Hi, I want to put a graph, something like TGraphErrors(n,x,y,xErr,yErr), onto an existing histogram (TH1F), and shrink the graph a little to let it cover the upper-right corner of the histogram.
Can anyone give me some hint about how to do that? Thanks a lot !

I tried to output the graph and the hist individually as 2 eps pictures, then tried to use other softwares to put the graph onto the hist, but I can not keep the quality of the picture.

You should plot the histogram first, then create a TPad at the position you like and plot the graph in that new pad. (I hope I understood what you want)

Thanks, will try … and, how to contral the position of the TPad?

At the TPad creation you specify its position. See: