Plotting a 2d function

Dear experts,

How can I plot a single 2D curve using root?

When I use

TF2 *f2 = new TF2("f2","((x-1)/0.0006)^2 + ((y-1)/0.0004)^2 -1.",0.,2.,0.,2.); 
f2->Draw();

I get multiple ellipses. I wanted an ellipse with an equation

((x-1)/0.0006)^2 + ((y-1)/0.0004)^2 -1 .= 0.

Thanking you
Kanhaiya Gupta


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


I guess @couet can help

TEllipse ?

What I wanted is the elliptical line to show a certain region. But how can I get the ellipse showing the boundary only? What I did is for ellipse centered at (1,1)

 TEllipse *el = new TEllipse(1.,1.,.1,.2);
el->Draw("same");

Thank you

The same as a box centred at 1,1

I am sorry, I did not understand how to do it. I just wanted an elliptical line to show a region.

(new TCanvas())->DrawFrame(0.999, 0.999, 1.001, 1.001); // just a test canvas
TEllipse *el = new TEllipse(1., 1., 0.0006, 0.0004); // ((x-1)/0.0006)^2 + ((y-1)/0.0004)^2 = 1
el->SetFillStyle(0);
el->Draw();

I am sorry this didn’t solve my problem. I wanted to show a signal-region on a 2D histogram. The plot that I obtain is the following

And the macros is scale_plot.C (625 Bytes)

el->SetFillStyle(0); el->Draw();

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