6

Though I've been able to create basic plots with matplotlib.pyplot before, I cannot fully understand what the difference between these are:

  • figure
  • subplot
  • axes
  • (axis?)

As I understand, all three of these are objects for the area in which a graph is drawn, so what distinguishes them in terms of what can be drawn inside them?

Jordan A.
  • 384
  • 1
  • 4
  • 17
  • Relevant here: [What are the differences between add_axes and add_subplot?](https://stackoverflow.com/questions/43326680/what-are-the-differences-between-add-axes-and-add-subplot) and [Matplotlib subplots vs axes vs axis (singular / plural)](https://stackoverflow.com/questions/45048255/matplotlib-subplots-vs-axes-vs-axis-singular-plural). – ImportanceOfBeingErnest Jan 01 '19 at 13:48

2 Answers2

5

Matplotlib's user guide gives a great description about the parts of a figure.

Ic3fr0g
  • 1,199
  • 15
  • 26
0

The components are hierarchical:

Figure object: the whole figure

Axes object: belongs to a Figure object and is the space where we add the data to visualize

Axis object: belongs to an Axes object. Axis object can be categorized as XAxis or YAxis.

For further info, visit this link:

Getting Started with Matplotlib

J R
  • 436
  • 3
  • 7