Skip to content

Preserve path breaks during interpolation - #1117

Merged
has2k1 merged 1 commit into
mainfrom
fix-munch-data-breaks
Sep 3, 2026
Merged

has2k1 merged 1 commit into
mainfrom
fix-munch-data-breaks

Conversation

@has2k1

@has2k1 has2k1 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Under a non-linear coordinate system, a geom_polygon with several groups draws an edge from one polygon to the next, and separate geom_path groups join up when an aesthetic varies along the line.

df = pd.DataFrame({
    "x": [1, 2, 2, 1, 3, 4, 4, 3],
    "y": [1, 1, 2, 2, 3, 3, 4, 4],
    "g": list("aaaabbbb"),
})

(
    ggplot(df, aes("x", "y", fill="g"))
    + geom_polygon(colour="black", size=1)
    + coord_trans(x="log10", y="log10")
)

Without this PR, a diagonal edge runs from the bottom-left corner of the first square to the second square.

Non-linear coordinates interpolated each marked break as if it were the
longest segment in the panel. The added points connected separate polygons
and path groups with a visible edge.

Marked breaks now keep only their starting point. Polygons and paths whose
aesthetics vary along a line therefore stop at each group boundary.
@has2k1
has2k1 merged commit adda64d into main Sep 3, 2026
13 checks passed
@has2k1
has2k1 deleted the fix-munch-data-breaks branch September 3, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant