In this recipe, we will learn how to plot a polygon plot. It is similar to a line plot, but filled under the line. We will use the same battery sales data for this example also.
Polygon plot
Getting ready
Import the required libraries:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
from matplotlib.ticker import MultipleLocator
How to do it...
Here are the steps to code the logic:
- Define the figure and axes for 3D plotting:
fig = plt.figure(figsize=(10,6))
ax = fig.add_subplot(111...