Skip to content

Commit 725ba00

Browse files
committed
Heatmap: round the item size to an integer value. This removes the aliasing artefacts but shrinks the plot-size considerably.
Next step will be, then, to allow data layout to change the plot-size. That's not going to be fun.
1 parent 0abb40b commit 725ba00

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/SwiftPlot/Heatmap.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ extension Heatmap: HasGraphLayout, Plot {
7373
width: size.width / Float(results.columns),
7474
height: size.height / Float(results.rows)
7575
)
76+
results.itemSize.width.round(.down)
77+
results.itemSize.height.round(.down)
7678
// Calculate markers.
7779
markers.xMarkers = (0..<results.columns).map {
7880
(Float($0) + 0.5) * results.itemSize.width

0 commit comments

Comments
 (0)