Adding a shadow to the chart line
To be able to distinguish one particular plot line in the figure or just to fit in the overall style of the output our figure is in, we sometimes need to add a shadow effect to the chart line (or histogram, for that matter). In this recipe, you will be learning how to add a shadow effect to the plot's chart lines.
Getting ready
To add shadows to the lines or rectangles in our charts, we need to use the transformation framework built in matplotlib and located in matplotlib.transforms
.
To understand how it all works, we need to explain what transformations are available in matplotlib and how they work.
Transformations know how to convert the given coordinates from their coordinate system into display. They also know ...
Get Python Data Visualization Cookbook - Second Edition 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.