80

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

3 Answers 3

119

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.

3
  • 3
    There is an equivalent image in current documentation, which many other concepts explained: matplotlib.org/stable/tutorials/introductory/…
    – abu
    Jan 28, 2022 at 20:22
  • Thanks for the update. I think that the old figure is more on point for the relevant question here. Mar 13, 2022 at 7:33
  • Yes, I agree. I decided to provide the new link just in case the old one stops working. But the old figure is much better to ilustrate the axes/axis difference.
    – abu
    Mar 13, 2022 at 19:44
71

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

1
  • 15
    Is one supposed to get less confused or more confused with this? You say "the axis of the plot, the thing that ..." as if there's a single axis, a single "thing"!!
    – Apostolos
    May 30, 2018 at 15:51
15

in the context of matplotlib,

axes is not the plural form of axis, it actually denotes the plotting area, including all axis.

2
  • 22
    This was a horrible design decision.
    – eric
    Mar 5, 2021 at 22:29
  • I also feel it confusing, especially axes is just plural form of axis in English. Nov 8, 2022 at 2:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.