I need to draw a graph of a function like this:

What is the most elegant way to do it?
You could use the substitution x = cos(t) to parameterise your set of equations for t ∈ [0, 2π) as x = cos(t), y = sin(t), z = 2x.
In Julia, you can use Plots.jl to plot this as follows:
using Plots
t = 0:0.01:2*pi
x = cos.(t)
y = sin.(t)
z = 2 .* x
plot(x, y, z)
A slightly neater trick is to use parametric plotting, where we can just pass functions (x(t), y(t), z(t)) and specify the range of the parameter t:
plot(cos, sin, x -> 2 * cos(x), 0, 2π, xlabel="x", ylabel="y", zlabel="z", label="f")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With