{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Managing multiple figures in pyplot\n\n\n`matplotlib.pyplot` uses the concept of a *current figure* and *current axes*.\nFigures are identified via a figure number that is passed to `~.pyplot.figure`.\nThe figure with the given number is set as *current figure*. Additionally, if\nno figure with the number exists, a new one is created.\n\n
We discourage working with multiple figures in pyplot because managing\n the *current figure* is cumbersome and error-prone. Instead, we recommend\n to use the object-oriented approach and call methods on Figure and Axes\n instances.