Skip to content

Instantly share code, notes, and snippets.

@genkuroki
Created June 19, 2017 13:26
Show Gist options
  • Save genkuroki/a3174bf6204909806dd442c12f06ac8e to your computer and use it in GitHub Desktop.
Save genkuroki/a3174bf6204909806dd442c12f06ac8e to your computer and use it in GitHub Desktop.
Julia/Plots Animation 3 in Julia.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {
"trusted": true,
"scrolled": false
},
"cell_type": "code",
"source": "using Plots\npyplot(leg=false, ticks=nothing)\nx = y = linspace(-5, 5, 40)\nzs = zeros(0,40)\n\n@gif for i in linspace(0, 2π, 100)\n f(x,y) = sin(x + 10sin(i)) + cos(y)\n\n # create a plot with 3 subplots and a custom layout\n l = @layout [a{0.7w} b; c{0.2h}]\n p = plot(x, y, f, st = [:surface, :contourf], layout=l)\n\n # add a tracking line\n fixed_x = zeros(40)\n z = map(f,fixed_x,y)\n plot!(p[1], fixed_x, y, z, line = (:black, 5, 0.2))\n vline!(p[2], [0], line = (:black, 5))\n\n # add to and show the tracked values over time\n zs = vcat(zs, z')\n plot!(p[3], zs, alpha = 0.2, palette = cgrad(:blues).colors)\nend",
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"text": "\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n",
"name": "stderr"
},
{
"output_type": "stream",
"text": "\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[31mWARNING: blues is found in more than one library: misc, colorcet. Choosing misc\u001b[0m\n\u001b[1m\u001b[34mINFO: Saved animation to C:\\home\\kuroki\\Dropbox\\Jupyter\\Julia\\tmp.gif\n\u001b[0m",
"name": "stderr"
},
{
"output_type": "execute_result",
"execution_count": 1,
"data": {
"text/plain": "Plots.AnimatedGif(\"C:\\\\home\\\\kuroki\\\\Dropbox\\\\Jupyter\\\\Julia\\\\tmp.gif\")",
"text/html": "<img src=\"tmp.gif?0.22288382010308916>\" />"
},
"metadata": {}
}
]
},
{
"metadata": {
"collapsed": true,
"trusted": false
},
"cell_type": "code",
"source": "",
"execution_count": null,
"outputs": []
}
],
"metadata": {
"kernelspec": {
"name": "julia-0.5",
"display_name": "Julia 0.5.2",
"language": "julia"
},
"language_info": {
"file_extension": ".jl",
"name": "julia",
"mimetype": "application/julia",
"version": "0.5.2"
},
"gist": {
"id": "",
"data": {
"description": "Julia/Plots Animation 3 in Julia.ipynb",
"public": true
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment