Setting the plot background to a white grid

The default plot style is a blue grid. We can change this to whitegrid with the following command:

sns.set()
sns.set_style("whitegrid")
sns.lmplot(x='beer_servings', y='wine_servings', data=df);

Seaborn provides a method called set_style, which we call and then pass whitegrid as the parameter. We then call our plotting method to draw our scatterplot. We are using seaborn's lmplot method for this. We then pass two column names from our dataset as x and y, and set the data parameter to our pandas DataFrame. We should now have a scatterplot with a white grid background, as shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.244.94