Closed julmb closed 6 months ago
I have confirmed that this also happens when using diagrams-svg
instead of diagrams-rasterific
to render to SVG files directly:
Nevermind, I overlooked the AlignmentFns
parameter to the createEnv
function. This gets rid of the artifacts, at the cost of misaligning text and straight lines like axes and ticks.
It would be nice if there was a way to have text, axes, ticks, etc. aligned to the pixel grid, while allowing things like line charts to be drawn at fractional coordinates for accuracy and lack of artifacts.
However, turning off alignment via vectorAlignmentFns
is good enough for me right now.
I am generating bitmap images of charts via
Chart
->Chart-diagrams
->diagrams-rasterific
->JuicyPixels
.Consider this chart:
On my system, this produces:
It seems to me like all start and end coordinates of lines are truncated to integer coordinates. This causes a single pixel tall bump in the blue line (despite
1e-12
being well below a single pixel at this resolution). It also causes aliasing artifacts in the lower two green lines and jaggedness (non-monotonous first derivative despite this being a plot of the exponential function) in the upper two green lines.