#240 basic area chart





An area chart can easily be done using python and matplotlib. Note that there are 2 main functions allowing to draw them. I advise to use the fill_between function that allows easier customisation. The stackplot function could work as well, but is more adapted for stacked area charts. The inputs are the same than for a scatterplot: 2 numerical variables.







# library
import numpy as np
import matplotlib.pyplot as plt

# Create data

# Area plot
plt.fill_between(x, y)

# Note that we could also use the stackplot function:
# but fill_between is more convenient for future customization.

  • Sponsors

  • 1 comment

    Leave a Reply

    Your email address will not be published.