These are chat archives for jheinen/GR.jl

Feb 2018
Rob J Goedman
Feb 07 2018 13:53

Is there a simple way to turn this into a 3d plot (vs. a contour plot) in Plots/GR:using Alg4Opt, Plots

ProjDir = dirname(@__FILE__)
cd(ProjDir) do
p = Vector{Plots.Plot{Plots.GRBackend}}(1);
f(x) = x[1]^2 - x[2]^2
x = -2.0:0.01:2.0
y = -2.0:0.01:2.0
z = [f([x1, x2]) for x2 in y, x1 in x]
p[1]=plot(x, y, z, w=1)
plot(p..., layout=@layout([a;]))

Josef Heinen
Feb 07 2018 14:09
Where can I find Alg4Opt?
ERROR: unknown package Alg4Opt
Rob J Goedman
Feb 07 2018 14:16
Sorry about that, it is a private pkg I use for testing the Julia code in an upcoming book (by Mykel Kochenderver and Tim Wheeler). That package is not used at all in this example. Just remove Alg4Opt from the using line.
Rob J Goedman
Feb 07 2018 14:21
Most graphics in the book are produced via PGFPlots but I was hoping to stick to Plots/GR.
Josef Heinen
Feb 07 2018 15:31
surface(x,y,z) ?
Screen Shot 2018-02-07 at 16.32.09.png
Rob J Goedman
Feb 07 2018 16:39
@jheinen Awesome! How have I missed this option????