I have the following problem when building with Plots.jl . I like to build the rosenbrock function
rosenbrock(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2
as a surface that is awaiting input of a 2d Tuple{Float64,Float64} .
What I can think of is this:
using Plots gr() rosenbrock(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2 ts = linspace(-1.0, 1.0, 100) x = ts y = map(rosenbrock, [(x, z) for (x,z) in zip(ts,ts)]) z = map(rosenbrock, [(x, y) for (x,y) in zip(ts,ts)]) # plot(x, x, z) plot(x, y, z, st = [:surface, :contourf])
which gives this graph: 
I think I messed up some measurements, but I donโt see that I was wrong.
Do I need to insert mapping calculations for y and x to get the result?
source share