Skip to content

geom_polygon() has useless lineend parameter #6140

Closed
@teunbrand

Description

@teunbrand

In addition to geom_polygon(), also other closed shape layers like geom_rect() have this parameter.
As these shapes are closed, there is no lineend to be drawn anywhere.

library(ggplot2)

ggplot(data.frame(x = c(1, 2, 2, NA), y = c(0, 0, 1, 1))) + 
  geom_polygon(
    aes(x, y),
    colour = "black", fill = 'grey50', linewidth = 5,
    lineend = "square"
  )

Created on 2024-10-16 with reprex v2.1.1

I think we should just throw the ignoring unknown parameter warning for these.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions