Multi plots in Julia

451 views Asked by At

Here is what I'd like to do : enter image description here

So, I have my function but I would like to change a parameter (Temperature,in case you're wondering) previously defined and have the 4 functions on the same plot. I'm looking for a option like replot in Gnuplot for instance. Here is what I've done so far using just Plots :

function L(v)
    defined the function here
    end;
plot(L,0,2000,title="Spectral Radiance",lw=2, xlabel = L"photon \ energy \ (cm^{-1})", 
    ylabel = L"W . m^{-2} . sr^{-1} . wavenumber^{-1}", label="300K")

So the Temperature has been previously defined for T = 2000 K, but now how can I change it to 3500,4500 and 5600 and display the results in the same plot ? Many thanks for any tips !

1

There are 1 answers

4
Nils Gudat On

As @crstnbr says, in Plots.jl you can do:

using Plots
function L(v)
    v .* rand(100)
end;

p = plot()
for v in 1:4
    plot!(L(v), label="factor $v")
end
display(p)