Personalización de gráficos

Introducción a la visualización de datos con Matplotlib

Ariel Rokem

Data Scientist

Personalización de la apariencia de los datos

ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-PRCP-NORMAL"])
plt.show()

Introducción a la visualización de datos con Matplotlib

Añadir marcadores

ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-PRCP-NORMAL"], 
        marker="o")
plt.show()

Introducción a la visualización de datos con Matplotlib

Elegir marcadores

ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-PRCP-NORMAL"], 
        marker="v")
plt.show()

https://matplotlib.org/api/markers_api.html

Introducción a la visualización de datos con Matplotlib

Configuración del estilo de línea

fig, ax = plt.subplots()
ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-TAVG-NORMAL"],
        marker="v", linestyle="--")
plt.show()

Introducción a la visualización de datos con Matplotlib

Eliminar líneas con linestyle

fig, ax = plt.subplots()
ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-TAVG-NORMAL"],
        marker="v", linestyle="None")
plt.show()

Introducción a la visualización de datos con Matplotlib

Elegir el color

fig, ax = plt.subplots()
ax.plot(seattle_weather["MONTH"], 
        seattle_weather["MLY-TAVG-NORMAL"],
        marker="v", linestyle="--", color="r")
plt.show()

Introducción a la visualización de datos con Matplotlib

Personalización de las etiquetas de los ejes

ax.set_xlabel("Time (months)")
plt.show()

Introducción a la visualización de datos con Matplotlib

Configuración de la etiqueta del eje y

ax.set_xlabel("Time (months)")
ax.set_ylabel("Average temperature (Fahrenheit degrees)")
plt.show()

Introducción a la visualización de datos con Matplotlib

Añadir un título

ax.set_title("Weather in Seattle")
plt.show()

Introducción a la visualización de datos con Matplotlib

¡Practica personalizando tus gráficos!

Introducción a la visualización de datos con Matplotlib

Preparing Video For Download...