LoslegenKostenlos loslegen

Univariate and bivariate plots in matplotlib

Matplotlib is at the core of all the plotting functions in Pandas and Seaborn. Understanding how matplotlib works will help you tweak your plot for publication or reports.

In this exercise, you will generate a histogram and scatterplot:

# Histogram
plt.hist(df['column_name'])
plt.show()

# Scatter plot
plt.scatter(df['x_column'], df['y_column'])
plt.show()

Recall that you need to call plt.show() to display the plot. We'll work with the pre-loaded dataset tips in this exercise.

Diese Übung ist Teil des Kurses

Python for R Users

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

import matplotlib.pyplot as plt

# Univariate histogram
plt____
____
Code bearbeiten und ausführen