J'utilise Plots.jl avec le backend GR.Plots.jl: tracés à l'intérieur du cycle
Pour tout, je ne peux pas sembler pouvoir tracer! l'intérieur d'une boucle for:
using Plots
fn(m,x) = m*x
plot([0, 10], [fn(1, 0), fn(1, 10)])
for m in 2:4
plot!([0, 10], [fn(m, 0), fn(m, 10)])
end
Étrangement, la même chose sans utiliser un cycle fonctionne:
using Plots
fn(m,x) = m*x
plot([0, 10], [fn(1, 0), fn(1, 10)])
plot!([0, 10], [fn(2, 0), fn(2, 10)])
plot!([0, 10], [fn(3, 0), fn(3, 10)])
plot!([0, 10], [fn(4, 0), fn(4, 10)])