Skip to content

width/height support in geom-rastor  #350

@kohske

Description

@kohske

Not sure if this is necessary, but will be useful.

df1 <- data.frame(x = c(1, 1, 2, 2), y = c(1, 2, 1, 2), z = 1:4)
df2 <- data.frame(x = 1:3, y = 1, z = 1:3)
df3 <- data.frame(y = 1:3, x = 1, z = 1:3)
df4 <- data.frame(x = 1:3, y = 1:3, z = 1:3)

f <- function(d) {
  p <- ggplot(d, aes(x, y, fill = z))
  print(p + geom_tile(aes(width = 0.1, height = 0.1)) + opts(title = "tile") + geom_text(aes(label = z), colour = "white"))
  print(p + geom_raster(aes(width = 0.1, height = 0.1)) + opts(title = "raster") + geom_text(aes(label = z), colour = "white"))
}

f(df1)
f(df2)
f(df3)
f(df4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions