JuliaKurs23/nb/makie.ipynb

78 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-05-12 20:12:56 +02:00
{
"cells": [
{
"cell_type": "raw",
"id": "7d6e8e63",
"metadata": {},
"source": [
"---\n",
"title: makie\n",
"---"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fff03da7",
"metadata": {},
"outputs": [],
"source": [
"using CairoMakie\n",
"\n",
"\n",
"f = Figure()\n",
"Axis(f[1, 1])\n",
"\n",
"xs = 1:0.2:10\n",
"ys_low = -0.2 .* sin.(xs) .- 0.25\n",
"ys_high = 0.2 .* sin.(xs) .+ 0.25\n",
"\n",
"band!(xs, ys_low, ys_high)\n",
"band!(xs, ys_low .- 1, ys_high .-1, color = :red)\n",
"\n",
"f"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "242380da",
"metadata": {},
"outputs": [],
"source": [
"f = Figure()\n",
"Axis(f[1, 1])\n",
"\n",
"xs = LinRange(0, 10, 100)\n",
"ys = LinRange(0, 15, 100)\n",
"zs = [cos(x) * sin(y) for x in xs, y in ys]\n",
"\n",
"contour!(zs,levels=-1:0.1:1)\n",
"\n",
"f"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ff5c9a2d",
"metadata": {},
"outputs": [],
"source": [
"fig, ax, hm = heatmap(randn(20, 20))\n",
"Colorbar(fig[1, 2], hm)\n",
"fig"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.8.5",
"language": "julia",
"name": "julia-1.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}