2
$\begingroup$

I want to draw some circles with different radius, and I want to keep them to be circle in any AspectRatio setting. I found that Offset needs to be used in radius to make absolute. However, I found peculiar behavior.

Graphics@{RGBColor[1, 0, 0], Thickness[0.3], Circle[{0.4666666666666667`, 0.48315`}, Offset[{0.1474,0.1474}]]}

Shows

enter image description here

What is wrong? It should be a circle. How to make it normal circle?

$\endgroup$
5
  • $\begingroup$ The syntax of Offset is wrong. It is in place of the radius and it is not of the form Offset[{..,..},{..,..}]. And you choose an incredible large value in Thickness, put it to e..g. 0.01. $\endgroup$ Dec 2, 2020 at 10:21
  • $\begingroup$ @DanielHuber You are right. Though not documented, but it seems that Offset[a] is equivalent to Offset[{a,a}]. Anyway, it doesn't solve the problem. The graphics is vector image, I don't see why a circle should not appear to be a circle at any scale $\endgroup$
    – matheorem
    Dec 2, 2020 at 11:30
  • $\begingroup$ I do not understand your definition of the radius. What should a radius of "Offset[..]" mean? $\endgroup$ Dec 2, 2020 at 11:40
  • $\begingroup$ @DanielHuber According to the doc of Offset: "Offset[{dx,dy}] can be used to specify an absolute radius in a Circle or Disk object. " $\endgroup$
    – matheorem
    Dec 2, 2020 at 12:36
  • $\begingroup$ I get a circle (V12.1.1, Mac): i.sstatic.net/WMPIS.png $\endgroup$
    – Michael E2
    Dec 2, 2020 at 14:10

1 Answer 1

1
$\begingroup$

This is not the output I get, but I am not surprised that the output is corrupted:

  • You are requesting a circle with a radius of 0.14 pixels
  • You set the thickness of the line to be 30% of the image width

Here's a more reasonable version:

Graphics@{RGBColor[1, 0, 0], Thickness[0.01], 
  Circle[{0.4666666666666667`, 0.48315`}, Offset[{20, 20}]]}

This is still very strange, as the circle radius is fixed, while the thickness is relative to the image width. Try resizing the image. This is more reasonable:

Graphics@{RGBColor[1, 0, 0], AbsoluteThickness[3], 
  Circle[{0.4666666666666667`, 0.48315`}, Offset[{20, 20}]]}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.