“complot de barre” Réponses codées

Comment augmenter la largeur de la barre dans Python Matplogtlib

plt.bar(x, y, width=30)
Python_Coder

Bar Plot Matplotlib

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
langs = ['C', 'C++', 'Java', 'Python', 'PHP']
students = [23,17,35,29,12]
ax.bar(langs,students)
plt.show()
Exuberant Eel

Comment tracer la barre sur Matplotlib

import matplotlib.pyplot as plt 

data = [5., 25., 50., 20.]
plt.bar(range(len(data)),data)
plt.show()

// to set the thickness of a bar, we can set 'width'
// plt.bar(range(len(data)), data, width = 1.)
regexp27

Bar Plot Python

import numpy as np
import matplotlib.pyplot as plt
data = [[30, 25, 50, 20],
[40, 23, 51, 17],
[35, 22, 45, 19]]
X = np.arange(4)
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.bar(X + 0.00, data[0], color = 'b', width = 0.25)
ax.bar(X + 0.25, data[1], color = 'g', width = 0.25)
ax.bar(X + 0.50, data[2], color = 'r', width = 0.25)
Powerful Pig

complot de barre

sns.barplot(x='sex',y='total_bill',data=t)Copy
Cooperative Caterpillar

complot de barre

sns.boxplot(x="day",y="total_bill",hue="smoker",data=t, palette="coolwarm")Copy
Cooperative Caterpillar

Réponses similaires à “complot de barre”

Questions similaires à “complot de barre”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code