December 17, 2019

Data Visualization

We can zoom in and out of our line graphs with plt.axis()
plt.axis([0,1,0,3])
- where the first number indicates the min X, the second indicates the max X, min and max Y for the third and fourth numbers.

We can label the x and y axes by uising plt.xlabel() and plt.ylabel()

The plot title can be set by using plt.title()

All of the label commands require quotes, either ‘ ‘ or “ “, but they must be consistent

We create subplots using plt.subplot()

The plt.subplot command needs three arguments passed to it
- the number of rows of subplots
- the number of columns of subplots
- the index of the subplot we want to create

We can customize the spacing between our subplots to make sure that the figure is visible and easy to understand. To do this, we use the plt.subplots_adjust() command.
plt.subplots_adjust() keywords
- left - bottom - wspace
- right - top - hspace
plt.subplots_adjust(bottom = 0.2)

Previous
Previous

December 19, 2019

Next
Next

December 14, 2019