Home | News | Documentation | Download

Issue with TEllipse

ROOT Version: 6.20/04
Platform: Linux Mint Tricia
Compiler: g++ 7.5.0


Hi, everyone!

This is the first time I’m using the TEllipse class and I’m really confused about one thing.

I want to draw a circle around a specific point of a 2D Histogram, let’s say (1,1). I’m setting the radius of the ellipse to be equal, but I’m still not getting a circle (I know this is a pretty dumb question, sorry)

This is the piece of my code where I try to draw the circle:

		//ellipse with (1,1) center and r1 = 1 and r2 = 1
		TEllipse *circle = new TEllipse(1.,1.,1.,1.);

		circle->SetFillStyle(0);
		circle->SetLineColor(kRed);
		circle->SetLineStyle(kDashed);
		circle->SetLineWidth(2);

		circle->Draw();

I want to create a circle with radius r=1 around the point (1,1), but this is what I get:

Once more: my apologies for the super simple question.

It is a circle, see the scales of the x and y axes.

Wow, thank you (now I’m embarrassed)!!!

Make your canvas square and it will show as a circle.