Circle is not a circle

I’m plotting a small circle into a canvas with TEllipse (see example macro below). When I look at the saved PDF file and zoom into the circle, the circle is actually not a circle but a polygon with 8 edges. Is there a draw option to increase the number of draw points?

Thank you,
Jochen

Root version 5.22/00 under cygwin

{
  TCanvas *c = new TCanvas("c","my canvas",0,0,400,400);
  c->Draw();
  TH1F *hframe = (TH1F*)c->DrawFrame(0, 0, 200, 200);

  TEllipse *e = new TEllipse(100,100,3,3);
  e->Draw();

  c->Print("canvas.pdf");
}

With the last root version I get the attached result. Seems to me I get the same on screen.
canvas.pdf (12.8 KB)

Thanks for the quick reply. Your attached PDF also shows an octagon. That was my point: TEllipse should give me a circle, not and octagon.

Jochen

Thanks for the quick reply. Your attached PDF also shows an octagon. That was my point: TEllipse should give me a circle, not and octagon.

Jochen[/quote]

I looked into the code of TEllipse.cxx and modified the ::PaintEllipse() method to improve the visual appeal of small ellipses by changing np from 200 to 2000.

I would like to suggest to add a method ::SetNPoints() to TEllipse (and related objects) so that a user can change the number of draw points.

Thank you,
Jochen

Dear All,

I’ve noticed that this exchange happened 10 years ago but the SetNPoints method nicely suggested by Jochen is still not in place and I am having the same problem again. I’ll use the hack that Jochen proposed but the better solution of ::SetNPoints would really be nice to have! (technically I guess the definite solution would be to export the arc as an arc and not bump up the number of points, but okay…)

Thank you and Best Regards,
David

Dear All,

Okay, quick reply to myself: I see the number of points has indeed been bumped up in the code but the problem still persists when drawing small ellipses. My use case is that I have a TCanvas that I’d like to export as an A4 page and I want to draw text-size ellipses which then look terrible. I’ll hack the code for now…

Thank you!
Best Regards,
David

Do you have a small macro reproducing your problem ?

Certainly: here goes… thank you for the quick reply!
DrawResponsePage01.C (1.6 KB)

Unfortunately one cannot change the number of point to draw the ellipse.
It is computed internally:
https://root.cern/doc/master/TEllipse_8cxx_source.html#l00526

may circular marker will be better for that wort of thing ?

Yes, that would be a possibility… though then I won’t have the option to adjust the thickness of the line, which is something I want to have if possible. In any case, my hacked version here produced the results I wanted, so I am happy for now :slight_smile: . Thanks a lot!

With hacking ROOT code you can also make a small macro drawing a circle with the number of points you want.