Thursday , May 19 2022
Home / Data Science / Stack Plot using Matplotlib

Stack Plot using Matplotlib

6 Stack Plot

Plot a Stack Plot using Matplotlib

Stack Plots are used to visualize multiple linear plots, stacked on top of each other. With a regular line plot, you’d plot the relationship between X and Y. Here, we’re plotting multiple Y features on a shared X-axis, one on top of the other:

In [3]:
import matplotlib.pyplot as plt 

days = [1,2,3,4,5]
sleeping = [7,8,6,11,7]
eating = [2,3,4,3,2]
working = [7,8,7,2,2]
playing = [8,5,7,8,13]

Lab = ['Sleeping','Eating','Working','Playing']

plt.title('Week Plan')
plt.ylabel('24 Hours')



About Machine Learning

Check Also

Scatter Plot using Matplotlib

5. Scatter Plot Plot Scatter Plot Using Matplotlib¶With Pyplot, you can use the scatter() function …

Leave a Reply

Your email address will not be published.