{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "- By [lazarusA](https://lazarusa.github.io/Webpage/index.html)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "using CairoMakie, ColorSchemes, Colors # using GLMakie" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "Figure()" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x = -1:0.05:1\n", "y = -1.5:0.05:2\n", "egg(x,y) = x^2 + y^2/(1.4 + y/5)^2\n", "segg = [egg(x,y) for x in x, y in y]\n", "\n", "fig = Figure(resolution = (700, 500))\n", "ax = LScene(fig, scenekw = (camera = cam3d!, show_axis = true))\n", "surf = surface!(ax, x, y, segg, colormap = (:matter, 0.8), transparency = true)\n", "xm, ym, zm = minimum(scene_limits(ax.scene))\n", "clines = contour!(ax, x, y, segg, linewidth = 1.2, colormap = :matter, \n", " levels = 0:0.02:1, transformation = (:xy, zm))\n", "\n", "axis = ax.scene[OldAxis]\n", "\n", "axis[:names, :axisnames] = (\"x\", \"y\", \"z\")\n", "tstyle = axis[:names] # get the nested attributes and work directly with them\n", "\n", "tstyle[:textsize] = 10\n", "tstyle[:gap] = 5\n", "axis[:ticks][:textcolor] = :black\n", "axis[:ticks][:textsize] = 5\n", "cbar = Colorbar(fig, surf, width = 12, height = Relative(2/4))\n", "fig[1, 1] = ax\n", "fig[1, 2] = cbar\n", "#save(\"./results/FigSurfCountour.png\", fig, px_per_unit = 1)\n", "fig" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "@webio": { "lastCommId": null, "lastKernelId": null }, "kernelspec": { "display_name": "Julia 1.6.0", "language": "julia", "name": "julia-1.6" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.6.0" } }, "nbformat": 4, "nbformat_minor": 2 }