From 3acbad741180afd2e5f7b03e77c8ca7e7681c34a Mon Sep 17 00:00:00 2001 From: Wen Wei Tseng Date: Sun, 14 Apr 2024 20:33:08 +0800 Subject: [PATCH] notebooks --- docs/_toc.yml | 2 +- docs/{plots.ipynb => pyplot.ipynb} | 16 +++++++++------- docs/pythonplot.jl | 6 ++---- docs/sub/plots-lit.jl | 5 +---- docs/sub/plots.ipynb | 17 ++++++++++------- 5 files changed, 23 insertions(+), 23 deletions(-) rename docs/{plots.ipynb => pyplot.ipynb} (84%) diff --git a/docs/_toc.yml b/docs/_toc.yml index 235881f..32516b7 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -4,7 +4,7 @@ format: jb-book root: index chapters: - - file: plots + - file: pyplot - file: pythonplot - file: sub/plots - file: sub/plots-lit diff --git a/docs/plots.ipynb b/docs/pyplot.ipynb similarity index 84% rename from docs/plots.ipynb rename to docs/pyplot.ipynb index 1218a56..a2b4b39 100644 --- a/docs/plots.ipynb +++ b/docs/pyplot.ipynb @@ -6,7 +6,9 @@ "id": "6a2385e8-96d9-4683-ade2-3cf50cb3ac6a", "metadata": {}, "source": [ - "# Plotting with PythonPlot.jl" + "# Plotting with PythonPlot.jl\n", + "\n", + "With Jupyter notebook." ] }, { @@ -25,7 +27,7 @@ "source": [ "import PythonPlot as plt\n", "using Random\n", - "Random.seed!(2022)\n" + "Random.seed!(2022)" ] }, { @@ -35,7 +37,7 @@ "metadata": {}, "outputs": [], "source": [ - "plt.plot(1:5, rand(1:6, 5))\n" + "plt.plot(1:5, rand(1:6, 5))" ] }, { @@ -45,7 +47,7 @@ "metadata": {}, "outputs": [], "source": [ - "versioninfo()\n" + "versioninfo()" ] }, { @@ -56,13 +58,13 @@ "outputs": [], "source": [ "import Pkg\n", - "Pkg.status()\n" + "Pkg.status()" ] } ], "metadata": { "kernelspec": { - "display_name": "Julia 1.10.0", + "display_name": "Julia 1.10.2", "language": "julia", "name": "julia-1.10" }, @@ -70,7 +72,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.10.0" + "version": "1.10.2" } }, "nbformat": 4, diff --git a/docs/pythonplot.jl b/docs/pythonplot.jl index f5b780f..c1c9a7e 100644 --- a/docs/pythonplot.jl +++ b/docs/pythonplot.jl @@ -1,23 +1,21 @@ #=== # Plotting with PythonPlot.jl -===# +Using Literate.jl +===# import PythonPlot as plt using Random Random.seed!(2022) #--- - plt.figure() plt.plot(1:5, rand(1:6, 5)) plt.gcf() # ## Runtime information - import Pkg Pkg.status() #--- - import InteractiveUtils InteractiveUtils.versioninfo() diff --git a/docs/sub/plots-lit.jl b/docs/sub/plots-lit.jl index 3572dac..79e58b4 100644 --- a/docs/sub/plots-lit.jl +++ b/docs/sub/plots-lit.jl @@ -1,22 +1,19 @@ #=== # Plotting by Plots.jl +Using Literate.jl ===# - using Plots using Random Random.seed!(2022) #--- - plot(rand(1:6, 5)) # ## Runtime information - import Pkg Pkg.status() #--- - import InteractiveUtils InteractiveUtils.versioninfo() diff --git a/docs/sub/plots.ipynb b/docs/sub/plots.ipynb index 228f5f8..8c5e652 100644 --- a/docs/sub/plots.ipynb +++ b/docs/sub/plots.ipynb @@ -6,7 +6,9 @@ "id": "6a2385e8-96d9-4683-ade2-3cf50cb3ac6a", "metadata": {}, "source": [ - "# Plotting with Plots.jl" + "# Plotting with Plots.jl\n", + "\n", + "With Jupyter notebook." ] }, { @@ -25,7 +27,8 @@ "source": [ "using Plots\n", "using Random\n", - "Random.seed!(2022)\n" + "Plots.default(fmt=:png)\n", + "Random.seed!(2024)" ] }, { @@ -35,7 +38,7 @@ "metadata": {}, "outputs": [], "source": [ - "plot(1:5, rand(1:6, 5))\n" + "plot(1:5, rand(1:6, 5))" ] }, { @@ -45,7 +48,7 @@ "metadata": {}, "outputs": [], "source": [ - "versioninfo()\n" + "versioninfo()" ] }, { @@ -56,13 +59,13 @@ "outputs": [], "source": [ "import Pkg\n", - "Pkg.status()\n" + "Pkg.status()" ] } ], "metadata": { "kernelspec": { - "display_name": "Julia 1.10.0", + "display_name": "Julia 1.10.2", "language": "julia", "name": "julia-1.10" }, @@ -70,7 +73,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.10.0" + "version": "1.10.2" } }, "nbformat": 4,