December 2017
Intermediate to advanced
386 pages
10h 42m
English
To start the plotting constructions, we use the figure() function, as shown in the following line of code:
plt.figure(figsize=(6,6))
The main purpose of this call is to set the figure size, which needs adjustment, since we plan to make several plots in the same figure. After creating the figure, we add four plots with code, as demonstrated in the following segment:
plt.subplot(2, 2, 3)yvalues = xvalues ** 3plt.plot(xvalues, yvalues, color='red')plt.xlabel('$x$')plt.ylabel('$x^3$')
In the first line, the plt.subplot(2, 2, 3) call tells pyplot that we want to organize the plots in a two-by-two layout, that is, in two rows and two columns. The last argument specifies that all following plotting commands should apply to the third ...
Read now
Unlock full access