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

[BUG] @recipe does not seem to like negative numbers #4048

Closed
cjwyett opened this issue Jan 19, 2022 · 1 comment
Closed

[BUG] @recipe does not seem to like negative numbers #4048

cjwyett opened this issue Jan 19, 2022 · 1 comment
Labels

Comments

@cjwyett
Copy link

cjwyett commented Jan 19, 2022

struct MyType
    x::Vector{Float64}
    y::Vector{Float64}
end

@recipe function mytypeplot(::Type{T}, mytype::T) where T <: MyType
    mytype.y, mytype.x
end

mytype = MyType([-2., -1., 0., 1., 2.], [1., 2., 3., 4., 5.])

plot(mytype, label="@recipe")
plot!(mytype.x, mytype.y, label="plot()")

I would expect the final 2 lines to plot the same thing. Only I get this:

plot

@cjwyett cjwyett added the bug label Jan 19, 2022
@cjwyett
Copy link
Author

cjwyett commented Jan 19, 2022

possibly related to #4047

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

2 participants