How to make each cylinder color different in python matplotlib drawing?
大家讲道理
大家讲道理 2017-05-18 10:50:43
0
1
640
def huitu_host(nodes,total):
    x = np.arange(len(nodes))
    plt.figure(figsize=(9,5))
    plt.xticks(x,nodes)
    plt.bar(x,total,width = 0.5,facecolor = 'yellowgreen',edgecolor = 'white')
    for x,y in zip(x,total):
        plt.text(x,y,'%.f' % y,ha="center", va="bottom")
    plt.show()
    return

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
左手右手慢动作

coloredgecolorThese can all be passed array-like parameters
Just specify the colors in the array respectively
Example:

x=np.arange(10)
y=np.arange(10)
plt.bar(x,y,color=['red','green'])

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!