Query-oriented statistical plotting
The visualization should always be guided by business queries. In the previous section, we saw the relationship between birth and death rates, population, and code, and with that, we designed how the graph should look.
In this section, we will see two more examples. The first example is about preprocessing data to meet the requirement of the plotting API in the seaborn
library. In the second example, we will integrate simple statistical analysis into plotting, which will also serve as a teaser for our next chapter.
Example 1 – preparing data to fit the plotting function API
seaborn
is another popular Python visualization library. With it, you can write less code to obtain more professional-looking plots. Some APIs are different, though.
Let's plot a boxplot. You can check the official documentation at https://seaborn.pydata.org/generated/seaborn.boxplot.html. Let's try to use it to plot the birth rates from different...