A picture is worth a thousand words. Data visualizations let you derive insights from data and let you communicate about the data with others.
import matplotlib.pyplot as plt
fig, ax= p
The fig operator **allows us to have a display for our plot on our page. **This is our canvas.
The ax is the operator that contains and allows us to displays the data on the page.
To do a simple plot through matplotlib we use the following. chunk of code.
ax.plot(table['column1'], table['column2'])
plt.show()
You can use the same chunk or plt.show section to plot two graphs at ones!
fig, ax= plt.subplots()
ax.plot(table1['column1'], table1['column2'])
ax.plot(table2['column1'], table2['column2'])
plt.show()
Lest visualize some data.
# Import the matplotlib.pyplot submodule and name it plt
import matplotlib.pyplot as plt
# Create a Figure and an Axes with plt.subplots
fig, ax = plt.subplots()
# Plot MLY-PRCP-NORMAL from seattle_weather against the MONTH
ax.plot(seattle_weather["MONTH"], seattle_weather["MLY-PRCP-NORMAL"])
# Plot MLY-PRCP-NORMAL from austin_weather against MONTH
ax.plot(austin_weather["MONTH"], austin_weather["MLY-PRCP-NORMAL"])
# Call the show function
plt.show()