6
$\begingroup$

Update: Apparently this is a version 13.2.1 and Windows platform-specific problem. I have submitted a tech-support request to WRI.


I am using version 13.2.1 on Windows. Notice that the lines do not pass through the centers of the points in the image below. I don't recall that being the case before I upgraded from 12.0. I've been using Mathematica since version 2.2, and don't recall this happening. Did something change?
Graphics[{Thin, Line[.1 {{1, 0}, {0,0}, {0, 1}}]
  , Point[.1 {{1/2, 0}, {0, 1/2}}]
  }, ImageSize -> Small]

enter image description here

$\endgroup$
12
  • $\begingroup$ Please notice that O2 is undefined $\endgroup$
    – bmf
    Feb 21, 2023 at 1:06
  • $\begingroup$ Meh. My bad. Does it work now? $\endgroup$ Feb 21, 2023 at 1:08
  • 1
    $\begingroup$ @bmf Frankly I see a misalignment in that image, the point on the left doesn't lie exactly on middle of the line. More interestingly, it is misaligned differently on my display. This is not the most significant misalignment phenomenon I've seen, reported to WRI, and has been accepted as a problem by them, though. $\endgroup$
    – kirma
    Feb 21, 2023 at 1:52
  • 1
    $\begingroup$ This is a bug on Windows system, no such problem on Linux or Mac OS. Another example is about tangent line or tangent circles. mathematica.stackexchange.com/a/274508/72111 $\endgroup$
    – cvgmt
    Feb 21, 2023 at 2:09
  • 1
    $\begingroup$ @cvgmt Points are definitely not rendered with same location accuracy as Disks on Mac either. I believe rendering coordinates of Points are rounded to some specific coordinate system which may not even correspond with the physical coordinate system on modern displays... but this is a small annoyance in comparison to the fact that coordinate axes and plotted zero values seem to also slightly disagree! (At least on my Mac: Plot[Ramp[x], {x, -1, 1}, ImageSize -> Small] // Rasterize- line on the negative side is clearly below the axis.) $\endgroup$
    – kirma
    Feb 21, 2023 at 2:17

1 Answer 1

6
$\begingroup$

This is a remnant from the days that all positions were integers for very fast drawing in Mathematica 2,3,4 or so. You can still see this behavior for certain graphical primitives in all versions (13.2 and even 13.3) in the output in Mathematica itself. Try scaling the Graphics object in the front-end (screenshot zoomed in a lot to make it more dramatic):

Graphics[Point[Table[{i, 0.1 i}, {i, 100}]]]

enter image description here

Note that in export and print this is all is fine. You can also see it does not happen with disks:

Graphics[Disk[#, 0.5] & /@ Table[{i, 0.1 i}, {i, 100}]]

enter image description here

Source: Rob Raguet-Schofield (former?) Mathematica developer, whom I contacted in 2010 on this very 'issue'.

$\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.