Saltar al contenido

función hist en el ejemplo de código matplotlib

Ejemplo 1: histograma matplotlib

import matplotlib.pyplot as plt
data = [1.7,1.8,2.0,2.2,2.2,2.3,2.4,2.5,2.5,2.5,2.6,2.6,2.8,
        2.9,3.0,3.1,3.1,3.2,3.3,3.5,3.6,3.7,4.1,4.1,4.2,4.3]
#this histogram has a range from 1 to 4
#and 8 different bins
plt.hist(data, range=(1,4), bins=8)
plt.show()

Ejemplo 2: histogramas de matplotlib

# Import packages
import matplotlib.pyplot as plt
%matplotlib inline

# Create the plot
fig, ax = plt.subplots()

# Plot the histogram with hist() function
ax.hist(x, edgecolor = "black", bins = 5)

# Label axes and set title
ax.set_title("Title")
ax.set_xlabel("X_Label")
ax.set_ylabel("Y_Label")

Ejemplo 3: histograma matplotlib

import pyplot from matplotlib as plt
plt.hist(x, bins=None, range=None, density=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, stacked=False, *, data=None, **kwargs)
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *