Customizing your plots

Introduction to Data Visualization with Matplotlib

Ariel Rokem

Data Scientist

Customizing data appearance

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

Introduction to Data Visualization with Matplotlib

Adding markers

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

Introduction to Data Visualization with Matplotlib

Choosing markers

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

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

Introduction to Data Visualization with Matplotlib

Setting the linestyle

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

Introduction to Data Visualization with Matplotlib

Eliminating lines with linestyle

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

Introduction to Data Visualization with Matplotlib

Choosing color

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

Introduction to Data Visualization with Matplotlib

Customizing the axes labels

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

Introduction to Data Visualization with Matplotlib

Setting the y axis label

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

Introduction to Data Visualization with Matplotlib

Adding a title

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

Introduction to Data Visualization with Matplotlib

Practice customizing your plots!

Introduction to Data Visualization with Matplotlib

Preparing Video For Download...