If you're willing to use Plots, here's the syntax (might be very close to Pyplot, not sure). It uses the pyplot backend
using Plots function rosenbrock(x::Vector) return (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2 end default(size=(600,600), fc=:heat) x, y = -1.5:0.1:1.5, -1.5:0.1:1.5 z = Surface((x,y)->rosenbrock([x,y]), x, y) surface(x,y,z, linealpha = 0.3) On Thursday, March 3, 2016 at 10:13:52 PM UTC+1, Ayush Pandey wrote: > > Hi, > > I have defined Rosenbrock function as > > *function rosenbrock(x::Vector)* > * return (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2* > *end* > > *m = rand(51,2)* > > I want to check the unimodality of the function by plotting(surface as > well as contour) over the points given by rows of matrix m. Can anyone help > how this can be achieved using PyPlot? > > > > > > *Yours Sincerely,* > *Ayush Pandey* * <https://github.com/Ayush-iitkgp> * > *LinkedIn Profile <https://www.linkedin.com/pub/ayush-pandey/66/9/a52> * > *GitHub <https://github.com/Ayush-iitkgp>* >
