国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

python - erreur matplotlib lors de la création d'un diagramme circulaire
過去多啦不再A夢
過去多啦不再A夢 2017-06-12 09:23:57
0
1
1097
def plot_graph():
    lables = '男生比例','女生比例','其他'
    sizes = get_friends_rate()
    plt.pie(sizes, lables, autopct='%.3f%%', shadow=False, startangle=90)
    plt.axis('equal')
    plt.show()
plot_graph()

Où def get_friends_rate() renvoie
return [float(male)/total 100, float(female)/total 100, float(other)/total * 100]
Une erreur s'est produite pendant l'opération?:

過去多啦不再A夢
過去多啦不再A夢

répondre à tous(1)
世界只因有你

Le code source suivant est utilisé?:

>>> from matplotlib import pyplot as plt
>>> sizes = 30,20,50
>>> lables = u'男生比例',u'女生比例',u'其他'
>>> plt.pie(sizes, labels=lables,autopct='%.3f%%', shadow=False, startangle=90)
>>> plt.axis('equal')
>>> plt.show()

Transmettez simplement les étiquettes en utilisant le paramètre labels. Python2.7 est utilisé pour l'écrire ici. Comme il est en chinois, il y aura un problème car il ne pourra pas être affiché.

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal