using Plots fschar(x,b) = b*x^2 plot_fschar() = begin x = -1:0.01:1 blist = [1/2,1,3/2,2] p = plot([],[],label=nothing) for b in blist y = fschar.(x,b) plot!(p,x,y,label="b=$b") end xlabel!("x ∈ [-1,1]") ylabel!("f_b(x)") p end plot_fschar() """ Here you can either initialize an empty plot (i.e. a plot that shows nothing) like I do with plot([],[],label=nothing), recall [] is an empty vector, or change the for loop to use an index and create p if i=1 and then just change it with plot! Once again one function that does everything for us when we call it, nothing is defined on the global (memory) scope. """