function contour1()
x = y = [-2*pi + 4*pi*i/100 for i in 1:100]
z = [sin(x[i]) * cos(y[j]) * sin(x[i]*x[i]+y[j]*y[j])/log(x[i]*x[i]+y[j]*y[j]+1)
for i in 1:100 for j in 1:100]
z_ = [z[i:i+99] for i in 1:100:10000]
data = contour(;z=z_, x=x, y=y)
plot(data)
end
contour1()
function contour3()
x = [-9, -6, -5 , -3, -1]
y = [0, 1, 4, 5, 7]
z = [10 10.625 12.5 15.625 20
5.625 6.25 8.125 11.25 15.625
2.5 3.125 5. 8.125 12.5
0.625 1.25 3.125 6.25 10.625
0 0.625 2.5 5.625 10]
trace = contour(x=x, y=y, z=z)
layout = Layout(title="Setting the X and Y Coordinates in a Contour Plot")
plot(trace, layout)
end
contour3()
function contour4()
z = [10 10.625 12.5 15.625 20
5.625 6.25 8.125 11.25 15.625
2.5 3.125 5. 8.125 12.5
0.625 1.25 3.125 6.25 10.625
0 0.625 2.5 5.625 10]
data = contour(;z=z, colorscale="Jet")
layout = Layout(;title="Colorscale for Contour Plot")
plot(data, layout)
end
contour4()
function contour5()
z = [10 10.625 12.5 15.625 20
5.625 6.25 8.125 11.25 15.625
2.5 3.125 5. 8.125 12.5
0.625 1.25 3.125 6.25 10.625
0 0.625 2.5 5.625 10]
data = contour(;z=z,
colorscale="Jet",
autocontour=false,
contours=Dict(:start=>0, :end=>8, :size=>2))
layout = Layout(;title="Customizing Size and Range of Contours")
plot(data, layout)
end
contour5()
function contour6()
z = [10 10.625 12.5 15.625 20
5.625 6.25 8.125 11.25 15.625
2.5 3.125 5. 8.125 12.5
0.625 1.25 3.125 6.25 10.625
0 0.625 2.5 5.625 10]
data = contour(;z=z, colorscale="Jet", dx=10, x0=5, dy=10, y0=10)
layout = Layout(;title="Customizing Spacing Between X and Y Axis Ticks")
plot(data, layout)
end
contour6()
function contour7()
z = [NaN NaN NaN 12 13 14 15 16
NaN 1 NaN 11 NaN NaN NaN 17
NaN 2 6 7 NaN NaN NaN 18
NaN 3 NaN 8 NaN NaN NaN 19
5 4 10 9 NaN NaN NaN 20
NaN NaN NaN 27 NaN NaN NaN 21
NaN NaN NaN 26 25 24 23 22]'
p1 = plot(contour(;z=z, showscale=false))
p2 = plot(contour(;z=z, connectgaps=true, showscale=false))
p3 = plot(heatmap(;z=z, zsmooth="best",showscale=false))
p4 = plot(heatmap(;z=z, zsmooth="best", connectgaps=true, showscale=false))
p = [p1 p2; p3 p4]
relayout!(p, title="Connect the Gaps Between Null Values in the Z Matrix")
p
end
contour7()