TEllipse outside a frame

Hi rooters!

I’m trying to draw an ellipse on top of a TH2 and I would like the ellipse to stay inside of the plot’s TFrame. Is there an (easy) way to do this? I’m attaching an image that shows the current behaviour an a sample script.
I’m running root 5.18/00 on ubuntu.



ellipsedemo.C (460 Bytes)

I am not sure to understand your report. Simply position the ellepse at the right place and with the right parameters. In your case, for instance, replace

TEllipse ellipse(5,0,5,5); by

TEllipse ellipse(-1,0,2,2);

Dear Rene,

Thanks for your reply and sorry about the poor explanation of my problem. The issue is that I have some other TH2 on top of which I would like to draw an ellipse, my problem is that I would prefer if the parts of the ellipse that are out of the range of the frame won’t show up in the pad.
I was thinking that, as the TEllipse constructor is called with user coordinates, the parts that are out of the user range won’t show up, although that’s not the case.
I think I could calculate the points of intersection of the ellipse with the frame and cut it using thetamin and thetamax, but I was wondering if there was another way.

Thanks again,