Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geom_tile no longer understands width and height outside aesthetics #1513

Closed
mariodejung opened this issue Jan 25, 2016 · 0 comments
Closed
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@mariodejung
Copy link

I just copy my problem from stack overflow to here since someone recommended to report this behaviour. (http://stackoverflow.com/questions/34986829)

Since switching to ggplot2 2.0.0 there are problems in defining the width and height of a tile outside the aesthetics.
I used the geom_tile to create some kind of a heatmap and I wanted to have a little space between the tiles, so I used in the older version of ggplot2 the width=.9 and height=.9 parameters, but this fails in the new version.

df <- data.frame(x=letters[1:10], y=rep(LETTERS[1:10], each=10), value=runif(100))
ggplot(df, aes(x, y, fill=value)) + geom_tile()
ggplot(df, aes(x, y, fill=value)) + geom_tile(width=.9, height=.9)

The only way to get this working is by adding columns with width and height into the data frame and use the aesthetics. Is this supposed to work like this? Or do I miss something here?

df <- data.frame(x=letters[1:10], y=rep(LETTERS[1:10], each=10), 
                 value=runif(100), w=.9, h=.9)
ggplot(df, aes(x, y, fill=value)) + geom_tile(aes(width=w, height=h))
@hadley hadley added the bug an unexpected problem or unintended behavior label Jan 25, 2016
@hadley hadley added this to the v2.1.0 milestone Jan 25, 2016
@hadley hadley closed this as completed in a4ba0bd Jan 25, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants