Skip to content

Could geom_bar/geom_col/geom_histogram support outline.type = "horseshoe"? #6587

@davidhodge931

Description

@davidhodge931

Currently in geom_bar/col/histogram, any colour outline is provided in full around the full polygon.

This can sometimes look a little messy with the geoms up against an axis line.

I notice in geom_bar/col/histogram there is a outline.type argument.

It'd be nice if there was an outline.type argument in geom_bar/col/histogram that defaults to "full" but could be changed to "horseshoe".

Ideally, the outline.type = "horseshoe" would adjust depending on the orientation of the plot.

So where normal orientation = "x", outline.type = "horseshoe" would not outline on the bottom of the polygon.

But with a orientation = "y", outline.type = "horseshoe" would not outline on the left of the polygon.

library(tidyverse)

palmerpenguins::penguins |>
  ggplot() +
  geom_bar(
    aes(x = species),
    colour = "red",
    linewidth = 1,
  ) +
  theme_classic() +
  scale_y_continuous(expand = c(0, 0)) +
  coord_cartesian(clip = "off")

Created on 2025-09-04 with reprex v2.1.1

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