Contours

Source code Author Update time

using Plots
gaston()

Any value for fill works here. We first build a filled contour from a function, then an unfilled contour from a matrix.

x = 1:0.5:20
y = 1:0.5:10
f(x, y) = begin
        (3x + y ^ 2) * abs(sin(x) + cos(y))
    end
X = repeat(reshape(x, 1, :), length(y), 1)
Y = repeat(y, 1, length(x))
Z = map(f, X, Y)
p1 = contour(x, y, f, fill = true)
p2 = contour(x, y, Z)
plot(p1, p2)
Gnuplot Produced by GNUPLOT 5.4 patchlevel 2 gnuplot_plot_1a 5 10 15 20 2 4 6 8 10 0 50 100 150 200 250 300 gnuplot_plot_1b 5 10 15 20 2 4 6 8 10

This page was generated using DemoCards.jl and Literate.jl.