Skip to content

Feature request: option for non-centered, left-hand and right-hand, linewidth #6373

Closed
@assaron

Description

@assaron

I'm using ggplot to plot borders of certain regions using geom_path and have a problem of certain regions sharing a border, resulting in an overlap of lines:

Image

I imagine, that the problem could be fixed by introducing a directional line-width. That is, one that will extend the segments, for example, only to the right-hand side of the line, instead of extending to both, as implemented currently. In that case I can specify the border points in a clock-wise order and make sure that the line will be always on the inside of the region.

I would appreciate thoughts on feasibility of this feature or any potential workarounds.

The code to reproduce the figure:

library(ggplot2)
library(data.table)
load(gzfile("border_example.rda.gz"))

ggplot(data, aes(x=UMAP_1, y=UMAP_2)) + 
    geom_point(color="grey") + 
    geom_path(data=maskTable, aes(group=group, color=cluster), linewidth=1) +
    coord_fixed() + 
    theme_classic()

border_example.rda.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions