Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "axes" and "axis" in matplotlib?

I'm confused about what the different between axes and axis is in matplotlib. Could someone please explain in an easy-to-understand way?

like image 364
bradley.ayers Avatar asked Apr 07 '11 03:04

bradley.ayers


People also ask

What is an axis in matplotlib?

Advertisements. Axes object is the region of the image with the data space. A given figure can contain many Axes, but a given Axes object can only be in one Figure. The Axes contains two (or three in the case of 3D) Axis objects.

Which is correct axis or axes?

Axis is a singular term, whereas, axes is a plural of axis. It does not have any other meaning; and whether it is to be used as an axis or axes, it depends on the context. For example: One axis defines one rotation. But, one can give an object more than one rotation, and they can have different axes.

What is matplotlib figure and axes?

A Figure object is the outermost container for a matplotlib graphic, which can contain multiple Axes objects. One source of confusion is the name: an Axes actually translates into what we think of as an individual plot or graph (rather than the plural of “axis,” as we might expect).


2 Answers

This figure from the documentation will answer your question:

enter image description here

You can find this image here (in the Matplotlib 1.x docs); it's actually been replaced in the Matplotlib 2.x docs.

like image 180
Heberto Mayorquin Avatar answered Oct 21 '22 16:10

Heberto Mayorquin


Axis is the axis of the plot, the thing that gets ticks and tick labels. The axes is the area your plot appears in.

like image 26
Bernhard Avatar answered Oct 21 '22 16:10

Bernhard