How to get correct colors in TLegend?


I have a problem with a TLegend: I want to draw a TGraph in two pads with different color. I managed to do this using DrawClone(). However, I also want to have a legend in each pad. The problem is that both legends will show the entry in the color that was used last for the TGraph. How can I make each legend to show the color of the graph that is actually used in the specific pad?

The attched macro shows the problem. I am using 4.00/04 on Fermilab Fedora.

test2.C (461 Bytes)

I have modified your script test2.C
see attachement

test2.C (481 Bytes)