Hi! I'm very new to julia, and I can't figure out for the life of me why the following code doesn't work.
using Plots
x = 1:10;
plot(x, x.^2)
which returns
LoadError: MethodError: no method matching plot(::UnitRange{Int64}, ::Vector{Int64})
Hey Jason, welcome! Very strange, could it be that you are using an out of date version of Plots.jl? What you wrote above seems to work fine for me (on Julia v.1.7.0, Plots.jl v1.25.2).
On a side note: We don't need to add semicolons to the end of every statement in Julia. They're mostly just for hiding the output that is automatically displayed if we want
thank you!
I was using Julia v1.6.2 and Plots.jl v1.23.2 ... I tried upgrading to Plots.jl v1.25.2 and it still didn't work. I wish I had a better answer for you, just in case someone else runs into this same issue in the future, but eventually it just started working. I have no clue what I did to fix this problem :-/
Still, thanks for all your help!
Last updated: Dec 28 2024 at 04:38 UTC