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

Update time axis raise dimension error #4769

Open
Beforerr opened this issue Feb 6, 2025 · 1 comment
Open

Update time axis raise dimension error #4769

Beforerr opened this issue Feb 6, 2025 · 1 comment
Labels

Comments

@Beforerr
Copy link

Beforerr commented Feb 6, 2025

The following code did not work for datatime

    n = 40
    t0 = DateTime(2020)
    t = Observable(range(t0, step=Hour(1), length=n))
    y = Observable(randn(n))
    f = lines(t, y)
    t.val = range(t0, step=Hour(1), length=2n)
    y[] = randn(2n)
    f

And raise ERROR: DimensionMismatch: arrays could not be broadcast to a common size: a has axes Base.OneTo(40) and b has axes Base.OneTo(80)

However, the logic would work for float without problem

begin
    n = 40
    x = Observable(range(1; length=n))
    y = Observable(randn(n))
    f = lines(x, y)
    x.val = range(1; length=2n)
    y[] = randn(2n)
    f
end
@Beforerr Beforerr added the bug label Feb 6, 2025
@Beforerr
Copy link
Author

Beforerr commented Feb 6, 2025

Converting to Point2 first would not raise error, but nothing is updated

begin
    t0 = DateTime(2020)
    ps = Observable(Point2.(range(t0, step=Hour(1), length=n), randn(n)))
    f = lines(ps)
    ps[] = Point2.(range(t0, step=Hour(1), length=3n), randn(3n))
    f
end

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

No branches or pull requests

1 participant