{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "3cTtnEob7hrd"
},
"source": [
"# matplotlib tutorial (15) nitta@tsuda.ac.jp\n",
"\n",
"# Chapter 15: Understand the relationship between the entire figure Figure
and the coordinate system Axes
\n",
"\n",
"Basically it is recommended to generate as many Axes as you need at the same time as creating the figure. \n",
"\n",
"However, if you want to create a weird Axes or have an Axes in a weird arrangement, first create a figure of the required size with figure()
.\n",
"\n",
"
\n", "matplotlib.figure.Figure(*args, **kwargs)\n", " [Parameters]\n", " figsize=(6.4, 4.8) : (width, height) dimension in inches\n", " dpi=100 : dots per inch\n", " [Returns]\n", " Artist: the added artist\n", "\n", "\n", "Then use
figure.add_axes(rect=[left, bottom, width, height])
to place new Axes in any position you like.\n",
"\n",
"\n", "matplotlib.figure.Figure.add_axes(self, *args, **kwargs)\n", " [Parameters]\n", " rect: [left, bottom, width, height]\n", " projection: projection types \n", " sharex, sharey: share x or y axis\n", " label: label for the returned axes\n", " [Returns]\n", " axes\n", "" ] }, { "cell_type": "markdown", "metadata": { "id": "4IJkWBhBEyKF" }, "source": [ "
\n",
"In the example below, it is specified as [left, bottom, width, height] = [0.1, 0.1, 0.8, 0.8]
when adding Axes, so the blue Axes are placed like the figure below.\n",
"\n",
"\n",
"In addition of the second Axes, it is specified as [left, bottom, width, height] = [0.6, 0.2, 0.4, 0.3]
, so the green Axes are place as follows.\n",
"