In Chapter 3, Plotting Multiple Charts, Subplots and Figures, we learned about plt.subplot(), plt.subplots(), and plt.subplot2grid() features, used to create various figure layouts. We will learn one more feature, GridSpec(), a little later in this chapter. Each of them gives an additional level of flexibility to design the required figure layouts. However, they all come with predefined parameters, using which axes positions in the figure are controlled. The ultimate flexibility a user can get is the ability to specify exact co-ordinates and the size of the axes to place within the figure layout. This is what we will learn in this recipe.
Taking control of axes positions
Getting ready
We will use the object-oriented API for...