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_col` mishandles x-axis `Date` with decimals #3873

Closed
thibautjombart opened this issue Mar 9, 2020 · 5 comments
Closed

`geom_col` mishandles x-axis `Date` with decimals #3873

thibautjombart opened this issue Mar 9, 2020 · 5 comments
Labels

Comments

@thibautjombart
Copy link

@thibautjombart thibautjombart commented Mar 9, 2020

geom_col does not handle Date on the x-axis when these contain decimals. Note that the input is still a valid Date object. This currently breaks incidence::plot.incidence as reported in this issue.

library(ggplot2)
x <- data.frame(date = Sys.Date() + 1:10, 
                y = 1:10)


## this works
ggplot(x) + geom_col(aes(x = date, y = y))

## this does not
ggplot(x) + geom_col(aes(x = date + 0.5, y = y))

## not sure if it affects other geoms; geom_point is fine:
ggplot(x) + geom_point(aes(x = date + 0.5, y = y))

Created on 2020-03-09 by the reprex package (v0.3.0)

@thibautjombart thibautjombart changed the title `geom_col` mishandles `Date` with decimals `geom_col` mishandles x-axis `Date` with decimals Mar 9, 2020
@thomasp85
Copy link
Member

@thomasp85 thomasp85 commented Mar 9, 2020

This is potentially a fallout from the bidirectional geom detection. We will look into a fix

@zkamvar
Copy link

@zkamvar zkamvar commented Jun 6, 2020

Hello, this issue should not have been closed. It is still alive and kicking with ggplot2 3.3.1:

library(ggplot2)
x <- data.frame(date = Sys.Date() + 1:10, y = 1:10)
## This works
ggplot(x) + geom_col(aes(x = date, y = y))

ggplot(x) + geom_col(aes(date + 0.5, y = y))

Created on 2020-06-06 by the reprex package (v0.3.0)

@yutannihilation
Copy link
Member

@yutannihilation yutannihilation commented Jun 6, 2020

You need to wait for 3.3.2.

@zkamvar
Copy link

@zkamvar zkamvar commented Jun 7, 2020

Can this issue be re-opened?

@thomasp85
Copy link
Member

@thomasp85 thomasp85 commented Jun 7, 2020

No, because it is already fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.