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

TidierPlots cannot handle DateTime axis and throws error on isless comparison #111

Closed
mbataillou opened this issue Aug 2, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mbataillou
Copy link

Describe the bug
TidierPlots cannot handle DateTime inputs while Makie can.

To Reproduce

using Tidier, DataFrames, Dates

x_values = Dates.DateTime("2024-10-10T00:00:00"):Dates.Minute(1):Dates.DateTime("2024-10-10T00:09:00");
y_values = 1:10;
df_line = DataFrame(X = x_values, Y = y_values);
ggplot(df_line) +
geom_line(@aes(x = X, y = Y)) +
labs(title = "Line Plot Example", x = "X axis", y = "Y axis")

Throws

Failed to show value:
MethodError: no method matching isless(::Dates.DateTime, ::Float64)

Expected behavior
I would expect the same behaviour as Makie

using CairoMakie
lines(x_values, y_values)
Screenshot 2024-08-02 at 10 33 47

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Paste the output of Pkg.status() here:

  [a93c6f00] DataFrames v1.6.1
  [f0413319] Tidier v1.4.0
  [ade2ca70] Dates
@mbataillou mbataillou added the bug Something isn't working label Aug 2, 2024
@rdboyes rdboyes self-assigned this Aug 9, 2024
@drizk1
Copy link
Member

drizk1 commented Sep 17, 2024

this now works too with the main version

x_values = Dates.DateTime("2024-10-10T00:00:00"):Dates.Minute(1):Dates.DateTime("2024-10-10T00:09:00");
y_values = 1:10;
df_line = DataFrame(X = x_values, Y = y_values);
ggplot(df_line) +
geom_line(@aes(x = X, y = Y)) +
labs(title = "Line Plot Example", x = "X axis", y = "Y axis")

download-1

@rdboyes rdboyes closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants