0%

Difference between `plt` `ax` and `figure` in Matplotlib

The hierarchy of pyplot (plt), ax, and figure

The plt is higher level api. In order to finely control the detail of a plot, it is better to use ax and/or figure instead.

  • figure:
    • Kind of the canvas
  • axes:
    • Which is definitely not only the axis in the plot
    • Include any objects in the plots
    • Contain anything we need to modify the detail of the plot
  • axis:
    • ax.xaxis and ax.yaxis the axis in the plot

Some objects in the Plots:

Thanks for Your Supports.