# Why does a translation in the horizontal direction affect PointSize?

I'm running Mathematica 9.0.1 under Mac OS X.

I'm not sure if this is a bug or whether I'm not supposed to apply a GeometricTransformation to a list containing graphic primitives and directives:

verts = {{0, 0}, {1, 0}, {Cos[60 Degree], Sin[60 Degree]}};
tri = {{PointSize[0.2], Point[verts]}, {Line[verts ~Append~ First@verts]}};


Translating purely in the vertical direction works how I expect it to:

Graphics[GeometricTransformation[tri, TranslationTransform[{0, #}] & /@ Range[0, 2]]] Graphics[GeometricTransformation[tri, TranslationTransform[{#, 0}] & /@ Range[0, 2]]]


However, if the translation has a horizontal component, then the point size gets messed up, in the sense that it's not compensating for the size of the points with respect to the size of the graphic in the notebook: Is this a bug?

From the docs of PointSize[]:

The diameter (of the point) is given as a fraction of the total width of the plot.

In other words, it adjusts point sizes relative to the width. Since your plot widened after the transformation, it stands to reason that your points should grow in size as well.

To drive the point home, ponder upon the result of

{Graphics[{PointSize[0.2], Point[{0, 0}]}, PlotRange -> {{-1, 1}, {-2, 2}}],
Graphics[{PointSize[0.2], Point[{0, 0}]}, PlotRange -> {{-10, 10}, {-2, 2}}]}
// GraphicsColumn


(I deliberately did not upload the picture of the result, so as not to spoil the surprise. :P )

If you don't want this growth, consider using AbsolutePointSize[] instead.

• It hadn't occurred to me to check the documentation for PointSize. I guess I was mistakenly expecting it to behave like the radius of a Disk[] object. – Aky May 25 '13 at 15:15

In my Mathematica work I frequently construct diagram in which I show polygons with their vertices represented by dots. I prefer to use Disk to draw the dots rather than Point because I feel doing so avoids the problems that can arise from having to specify the point size with either PointSize or AbsolutePointSize.

Your question illustrates the problem that can arise from using PointSize. Now let's look at the problem that can arise from using AbsolutePointSize.

verts = {{0, 0}, {1, 0}, {Cos[60 Degree], Sin[60 Degree]}};
tri = {{AbsolutePointSize,  Point[verts]}, {Line[verts~Append~First@verts]}};


The choice of 12pts looks good when the graphic is drawn at the default image size.

Graphics[GeometricTransformation[tri, TranslationTransform[{#, 0}] & /@ Range[0, 2]]] But look what happens when the image is down-sized by supplying an explicit ImageSize option. I think the vertices now look too big relative to the triangles because they do not change size.

Graphics[GeometricTransformation[tri,
TranslationTransform[{#, 0}] & /@ Range[0, 2]], ImageSize -> 150] Because problems can arise with both PointSize and AbsolutePointSize, I recommend representing vertices in graphics by Disk rather than Point. I further recommend using Polygon rather than Line for drawing polygons (the default filling of the polygon is easily removed).

vertices = {{0, 0}, {1, 0}, {Cos[60 Degree], Sin[60 Degree]}};
vertexPts = Disk[#, 0.06] & /@ vertices;
triangle = {Transparent, EdgeForm[Black], Polygon[vertices]};

Graphics[GeometricTransformation[{triangle, vertexPts},
TranslationTransform[{#, 0}] & /@ Range[0, 2]]] Now if I reduce the image size, the dots representing the shrink proportionally.

Graphics[GeometricTransformation[{triangle, vertexPts},
TranslationTransform[{#, 0}] & /@ Range[0, 2]], ImageSize -> 150] You might also consider one more simplification: using Translate in place of GeometricTransformation and TranslationTransform. Translate will give simpler code in your particular example and in many similar situations.

Graphics[Translate[{triangle, vertexPts}, {#, 0}] & /@ Range[0, 2]] Graphics[Translate[{triangle, vertexPts}, {0, # Sin[60 Degree]}] & /@ Range[0, 2]] • One could use FaceForm[None] instead of Transparent so that only the polygons are affected. – J. M.'s technical difficulties May 26 '13 at 5:09
• @J.M. +1 I have always wrapped my polygons in their own List along with Transparent, so it has never caused a problem for me. But I can see that, in general, using FaceForm[None] is cleaner. – m_goldberg May 27 '13 at 0:29