Matplotlib is the most popular Python library for Data Visualization. It is a multi-platform, 2D plotting library and supports a…