︠d89cafe5-86ee-43d4-8499-1c8cb7a86daei︠ %md # testing Gaston with Julia in CoCalc in a Sage worksheet Gaston provides an interface to gnuplot from the Julia language system. Selected examples from the excellent [Gaston Tutorial](https://nbviewer.jupyter.org/github/mbaz/Gaston.jl/blob/master/doc/gaston-tutorial.ipynb) There is a [Jupyter notebook version](https://cocalc.com/projects/db982efa-e439-4e2d-933b-7c7011c6b21a/files/Public/gaston-demo.ipynb?session=default) of this worksheet. ## links - https://github.com/mbaz/Gaston.jl - https://docs.julialang.org/en/stable/manual/packages/ - https://nbviewer.jupyter.org/github/mbaz/Gaston.jl/blob/master/doc/gaston-tutorial.ipynb ︡e903cf59-db95-4321-9442-81a9e7d722fc︡{"done":true,"md":"\n# testing Gaston with Julia in CoCalc in a Sage worksheet\n\nGaston provides an interface to gnuplot from the Julia language system.\n\nSelected examples from the excellent [Gaston Tutorial](https://nbviewer.jupyter.org/github/mbaz/Gaston.jl/blob/master/doc/gaston-tutorial.ipynb)\n\nThere is a [Jupyter notebook version](https://cocalc.com/projects/db982efa-e439-4e2d-933b-7c7011c6b21a/files/Public/gaston-demo.ipynb?session=default) of this worksheet.\n\n## links\n\n- https://github.com/mbaz/Gaston.jl\n- https://docs.julialang.org/en/stable/manual/packages/\n- https://nbviewer.jupyter.org/github/mbaz/Gaston.jl/blob/master/doc/gaston-tutorial.ipynb"} ︠bfdb5f68-b157-4d42-90a6-c8489f5ac72es︠ %auto %default_mode julia ︡d2e8d9d0-8d4f-4b2a-a693-74ad5b8ef311︡{"done":true}︡ ︠4ceb503d-ea15-4459-8723-09ec0058069as︠ versioninfo() ︡33b62b52-9fd7-4b39-b043-b6b04f063777︡{"stdout":"Julia Version 0.6.2\nCommit d386e40c17 (2017-12-13 18:08 UTC)\nPlatform Info:\n OS: Linux (x86_64-pc-linux-gnu)\n CPU: Intel(R) Xeon(R) CPU @ 2.20GHz\n WORD_SIZE: 64\n BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)\n LAPACK: libopenblas64_\n LIBM: libopenlibm\n LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)\n"}︡{"done":true}︡ ︠572936f5-b0e9-43e0-9bb7-d8a555e4cd40s︠ Pkg.status() ︡bee89cff-f241-42ac-bce6-91eb9f00cd49︡{"stdout":"1 required packages:\n - Gaston 0.7.4\n"}︡{"done":true}︡ ︠d35e4a2f-2add-4ce4-a5bc-6ef8086d2845s︠ Pkg.add("Gaston") ︡adf96f39-8515-4f03-b6ba-cb5767922991︡{"html":"
INFO: Package Gaston is already installed\n
"}︡{"done":true}︡ ︠a7a02c79-cf29-44f6-ad3f-9870bde8eeefs︠ # make sure gnuplot is installed run(`gnuplot --version`) ︡e45cb038-9870-40f9-9aa8-9881dc2ecc41︡{"stdout":"gnuplot 5.0 patchlevel 3\n"}︡{"done":true}︡ ︠7dce5fe3-55ad-4049-aa2d-0098d8190ac2s︠ using Gaston ︡d1cc6414-f6db-4265-b81c-4c18c826b07b︡{"done":true}︡ ︠334c3c67-12b3-46ff-8115-35ad16c6d439s︠ # 2D plot t = 0:0.01:1 plot(t, sin.(2π*5*t)) ︡cad77c88-1463-4e5b-aa4e-4629857ab407︡{"file":{"filename":"/tmp/tmp7J7IpC.png","show":true,"text":null,"uuid":"dfe45e38-0406-4dc5-9a12-81df2f6dd513"},"once":false}︡{"stdout":"1"}︡{"done":true}︡ ︠bc54d567-4cee-4eef-b89e-5d29c697c39as︠ # 3D plot x = y = -15:0.33:15 surf(x,y,(x,y)->sin.(sqrt.(x.*x+y.*y))./sqrt.(x.*x+y.*y),title="Sombrero",plotstyle="pm3d") ︡4afd112f-3d01-40c4-9380-2292a2e7b5f4︡{"file":{"filename":"/tmp/tmpVZMaew.png","show":true,"text":null,"uuid":"3cf4d72f-ff34-4c8f-8014-e626a89c1a32"},"once":false}︡{"stdout":"1"}︡{"done":true}︡ ︠7630eba0-c662-47b9-a0a4-194837de6c5fs︠ # image Z = [5 4 3 1 0; 2 2 0 0 1; 0 0 0 1 0; 0 1 2 4 3] imagesc(Z,title="Simple scaled image") ︡52c009b1-a92a-41ce-a571-cf5be56ddedb︡{"file":{"filename":"/tmp/tmpL8yUqx.png","show":true,"text":null,"uuid":"cab180a6-a4fb-4299-8f51-c0d4d92fd8b5"},"once":false}︡{"stdout":"1"}︡{"done":true}︡ ︠f20e641b-aac3-48a7-825a-45810d0bdfecs︠ # histogram histogram(rand(1000),bins=15,norm=1,title="Histogram",yrange="[0:1.6]") ︡64e370c6-7704-49b7-977e-0d4846b0e992︡{"file":{"filename":"/tmp/tmp73VSZn.png","show":true,"text":null,"uuid":"463e9ac5-5e94-400c-a0cb-bf696fb3077c"},"once":false}︡{"stdout":"1"}︡{"done":true}︡ ︠062bbabf-2936-4b9d-ad53-4a7ae104f8a6︠