Matplotlib.pyplot.stackplot() in Python
Example #1 : Using Stackplot
The code describes the x-axis as number of days from Monday to Friday while Y-axis is represented by No of Study and playing time is represented by red and cyan color respectively.
import matplotlib.pyplot as plt
# List of Days
days = [1, 2, 3, 4, 5]
# No of Study Hours
Studying = [7, 8, 6, 11, 7]
# No of Playing Hours
playing = [8, 5, 7, 8, 13]
# Stackplot with X, Y, colors value
plt.stackplot(days, Studying, playing,colors =['r', 'c'])
# Days
plt.xlabel('Days')
# No of hours
plt.ylabel('No of Hours')
# Title of Graph
plt.title('Representation of Study and
Playing wrt to Days')
# Displaying Graph
plt.show()

Example #2 : Using Stackplot
Python3
|
Output:
Below represents the output of graph if the value of baseline is set to zero
最后
以上就是无奈画笔最近收集整理的关于【数据可视化】Stackplot的全部内容,更多相关【数据可视化】Stackplot内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复