April 2018
Beginner to intermediate
300 pages
7h 34m
English
While a blank plot background is clean, sometimes we may like to get some reference gridlines for better reference, such as in the multiline case.
We can turn on the background gridlines by calling plt.grid(True) before plt.show(). For example, we can add this command to the preceding multi-city temperature plot to obtain the following plot:

Similarly, when we do not want the grid any longer, such as when using styles with gridlines as the default, we can use plt.grid(False) to remove the grid.
Detailed styling options will be discussed in the next chapter. The grid in the preceding example distinctly stands out too much and ...
Read now
Unlock full access