![]() Here we have to choose the axes carefully so that all the subplots can fit in to the grid. ![]() For this we use the function subplot2grid. We can also create a grid containing different graphs each of which is a subplot. Example import matplotlib.pyplot as pltĪxes1 = fig.add_axes() # main axesĪxes2 = fig.add_axes() # inset axesĪxes3 = fig.add_axes() # inset axes We can have two or more plots on a single canvas by creating multiple axes and using them in the program. Running the above code gives us the following result − Example from matplotlib import pyplot as plt We are plotting the graph for the trigonometric function − tan. ![]() Here we can apply labels and show the title of the graph as shown below. Then we use matplotlib to plot the graph for that function. Here we take a mathematical function to generate the x and Y coordinates of the graph. In this article we will see some of the different kinds of graphs it can generate. It along with numpy and other python built-in functions achieves the goal. It has numerous packages and functions which generate a wide variety of graphs and plots. Python has the ability to create graphs by using the matplotlib library.
0 Comments
Leave a Reply. |