{
	"cell_id" : 8855944566024926689,
	"cells" : 
	[
		{
			"cell_id" : 2976888846447930228,
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				{
					"cell_id" : 11861417834005874398,
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "\\section*{Plotting data and functions}\n\nThis notebook shows how to make plots of data and functions. Cadabra notebooks can display \nplots which are generated by matplotlib, so you have the full machinery of that library\nat your disposal to visualise your maths.\n\n\\subsection*{Basic plotting with matplotlib}\n\nThe first example that we will show is a basic matplotlib plot of a number of data points.\nYou can find examples of this on any matplotlib tutorial. The only difference is how you make\nthe plot appear in your Cadabra notebook.\n\nWe start by generating the plot and storing it in a variable $p$."
				}
			],
			"hidden" : true,
			"source" : "\\section*{Plotting data and functions}\n\nThis notebook shows how to make plots of data and functions. Cadabra notebooks can display \nplots which are generated by matplotlib, so you have the full machinery of that library\nat your disposal to visualise your maths.\n\n\\subsection*{Basic plotting with matplotlib}\n\nThe first example that we will show is a basic matplotlib plot of a number of data points.\nYou can find examples of this on any matplotlib tutorial. The only difference is how you make\nthe plot appear in your Cadabra notebook.\n\nWe start by generating the plot and storing it in a variable $p$."
		},
		{
			"cell_id" : 3524910430355576331,
			"cell_origin" : "client",
			"cell_type" : "input",
			"source" : "import matplotlib.pyplot as plt\nimport numpy as np\np=plt.plot([1,2,3,4,5],[1,2,5,3,2],'-o')"
		},
		{
			"cell_id" : 4051443736501369881,
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				{
					"cell_id" : 12066997917657158100,
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "We then make it appear in the notebook using the \\verb|display| command. This command figures\nout the type of the object which you hand it, and sends the appropriate data to the notebook\ninterface."
				}
			],
			"hidden" : true,
			"source" : "We then make it appear in the notebook using the \\verb|display| command. This command figures\nout the type of the object which you hand it, and sends the appropriate data to the notebook\ninterface."
		},
		{
			"cell_id" : 2311842112467759032,
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				{
					"cell_id" : 9223372036854775810,
					"cell_origin" : "server",
					"cell_type" : "image_png",
					"source" : "[encoded data, 29292 characters]"
				}
			],
			"source" : "display(p[0])"
		},
		{
			"cell_id" : 83377570136931709,
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				{
					"cell_id" : 5599987191402776889,
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "\\subsection*{3D plotting with matplotlib}"
				}
			],
			"hidden" : true,
			"source" : "\\subsection*{3D plotting with matplotlib}"
		},
		{
			"cell_id" : 16771518769536471597,
			"cell_origin" : "client",
			"cell_type" : "input",
			"source" : "from mpl_toolkits.mplot3d import axes3d\nimport matplotlib.pyplot as plt\nfig=plt.figure()\nax=fig.add_subplot(111,projection='3d')\nX,Y,Z = axes3d.get_test_data(0.05)\ncset = ax.contour(X,Y,Z)\nax.clabel(cset,fontsize=9,inline=1)"
		},
		{
			"cell_id" : 3589770310753153079,
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				{
					"cell_id" : 9223372036854775813,
					"cell_origin" : "server",
					"cell_type" : "image_png",
					"source" : "[encoded data, 105988 characters]"
				}
			],
			"source" : "display(fig)"
		},
		{
			"cell_id" : 16870455449402682855,
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				{
					"cell_id" : 9868180105062890100,
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "\\subsection*{Plotting functions with sympy}\n\nIn order to plot symbolic functions, rather than numerical data, use sympy. This library can\ngenerate both two-dimensional and three-dimensional plots."
				}
			],
			"hidden" : true,
			"source" : "\\subsection*{Plotting functions with sympy}\n\nIn order to plot symbolic functions, rather than numerical data, use sympy. This library can\ngenerate both two-dimensional and three-dimensional plots."
		},
		{
			"cell_id" : 16432830887788007622,
			"cell_origin" : "client",
			"cell_type" : "input",
			"source" : "from sympy.plotting import plot, plot3d\nx,y=symbols('x y')\np1=plot3d(sin(x)*y)\np2=plot(sin(x)*x**2)"
		},
		{
			"cell_id" : 18220392128932635794,
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				{
					"cell_id" : 9223372036854775816,
					"cell_origin" : "server",
					"cell_type" : "image_png",
					"source" : "[encoded data, 141992 characters]"
				},
				{
					"cell_id" : 9223372036854775817,
					"cell_origin" : "server",
					"cell_type" : "image_png",
					"source" : "[encoded data, 36184 characters]"
				}
			],
			"source" : "display(p1)\ndisplay(p2)"
		},
		{
			"cell_id" : 9864811625027922680,
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				{
					"cell_id" : 9223372036854775819,
					"cell_origin" : "server",
					"cell_type" : "output",
					"source" : "\\begin{verbatim}cartesian surface: y*sin(x) for y over (-10.0, 10.0) and x over (-10.0, 10.0)\n\\end{verbatim}"
				}
			],
			"source" : "print(p1[0])"
		},
		{
			"cell_id" : 8575285083676239171,
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				{
					"cell_id" : 9223372036854775820,
					"cell_origin" : "server",
					"cell_type" : "output",
					"source" : "\\begin{verbatim}<matplotlib.figure.Figure object at 0x7f4e59637e80>\n\\end{verbatim}"
				}
			],
			"source" : "print(repr(p1._backend.fig))"
		},
		{
			"cell_id" : 12533899187916108365,
			"cell_origin" : "client",
			"cell_type" : "input",
			"source" : ""
		}
	],
	"description" : "Cadabra JSON notebook format",
	"version" : 1
}
