How it works...

Here is the explanation for the preceding code:

This is the first plot:

  • sns.distplot(snacks_sales.Coffee, color='g', rug=True, rug_kws={"color": 'm', "height": 0.1}) plots. This is the required distribution plot.
  • snacks_sales.Coffee is the coffee sales data whose distribution is to be plotted.
  • color='g' specifies that the color of the histogram and KDE plots that are plotted by default is green.
  • If you want to switch off the histogram or KDE plot, then pass the arguments hist=False and kde=False.
  • rug=True specifies whether the rug plot should be plotted on this distribution plot. The default option is False, hence it is not plotted.
  • rug_kws={"color": 'm', "height": 0.1} is the keyword dictionary to be used to format the rug ...

Get Matplotlib 3.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.