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

Incorrect error message when types of arrays differ #64

Closed
KristofferC opened this issue Nov 10, 2015 · 1 comment
Closed

Incorrect error message when types of arrays differ #64

KristofferC opened this issue Nov 10, 2015 · 1 comment

Comments

@KristofferC
Copy link
Contributor

This happens sometimes when I do list comprehensions in global scope and type inference fails:

using Plots
data = rand(10)
x = [data[i] for i in 1:length(data)]
plot(data,x)

ERROR: AssertionError: length(x) == length(y)
 in computeXandY at /home/kristoffer/.julia/v0.4/Plots/src/plot.jl:244

The vectors here are obviously of the same length so maybe the error message can be tweaked?

@tbreloff
Copy link
Member

This is not a simple case of error message, unfortunately. Likely this is interpreted as "plot 10 series, each x[i] vs data". I'll see if I can improve the dispatch logic to check for numeric vectors without types, but that implies I'd need to make a pass though the data to check each type... Not ideal.

On Nov 10, 2015, at 11:56 AM, Kristoffer Carlsson [email protected] wrote:

This happens sometimes when I do list comprehensions in global scope and type inference fails:

using Plots
data = rand(10)
x = [data[i] for i in 1:length(data)]
plot(data,x)

ERROR: AssertionError: length(x) == length(y)
in computeXandY at /home/kristoffer/.julia/v0.4/Plots/src/plot.jl:244
The vectors here are obviously of the same length so maybe the error message can be tweaked?


Reply to this email directly or view it on GitHub.

t-bltg pushed a commit that referenced this issue Oct 6, 2022
t-bltg pushed a commit that referenced this issue Oct 6, 2022
Jonas-a-Zimmermann pushed a commit to Jonas-a-Zimmermann/Plots.jl that referenced this issue Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants