In object-oriented API, first, we create a canvas on which we have to plot the graph and then we plot the graph. Many people prefer object-oriented API because it is easy to use as compared to functional API.
Let’s try to understand this with some examples.
Everything is pretty much clear in the first example but there is a thing that needs to be focused on, “Setting size of the canvas”, what this basically means is to set the size of the figure on which you want to plot the graph, the syntax is like this.
add_axes([left, bottom, width, height])
The values of left, bottom, height and width lies between 0 to 1. Another example will make you more clear about this concept.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.