Skip to content

Ignoring unknown aesthetics "width" for geom_col() #2473

Closed
@Ryo-N7

Description

@Ryo-N7

Similar to issue #2066 , I still am getting unexpected warning messages when width aesthetic clearly specified.

library(ggplot2)
library(dplyr)

## Inputs ----
Low_Level <- -0.848744744010952

df <- data_frame(IndicatorName = c("Ind 04", "Ind 05", "Ind 07", "Ind 11", "Ind 17", "Ind 18"),
                 Perc = c(21.4285714, 100, 95.2380952, 0.4260676, 20, 50),
                 PercWeek = c(21.4285714, 100, 85.7142857, 0.1936671, 20, 50),
                 PercYear = c(21.42857, 61.7284, 95.2381, 19.36671, 20, 50),
                 BehindBy = c(-8.487337, 0, 0, -8.487337, -8.487337, 0))

## Plot ----
ggplot(df, aes(x = IndicatorName)) + 
  geom_col(aes(y = PercWeek, width = 0.5), alpha = 0.6) +
  geom_col(aes(y = PercYear, width = 0.75), alpha = 0.3) +
  geom_col(aes(y = Perc, width = 0.15, fill = BehindBy), color = "black") + 
  scale_fill_gradient("", limits = c(Low_Level, 0), low = "red", high = "green", 
                      guide = FALSE) +
  coord_flip()
#> Warning: Ignoring unknown aesthetics: width

#> Warning: Ignoring unknown aesthetics: width

#> Warning: Ignoring unknown aesthetics: width

Created on 2018-03-06 by the reprex package (v0.2.0).

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