Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære JointGrid | Multi-Plot Grids
Deep Dive into the seaborn Visualization

bookJointGrid

JointGrid is a figure-level function, when the function is called a JointGrid object is instantiated. The function creates a JointGrid object consisting of three axes objects but does not plot anything on it.

carousel-imgcarousel-imgcarousel-imgcarousel-imgcarousel-imgcarousel-img
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt

df = pd.read_csv('filename.csv')

# Creating the JointGrid variable
g = sns.JointGrid(x = 'column_name', y = 'column_name', data = df)

# Creating the inside plot
g.plot_joint(sns.scatterplot)

# Creating the outside plot
g.plot_marginals(sns.histplot)

plt.show()
Opgave

Swipe to start coding

  1. Set the 'ticks' style with the 'lightcyan' figure.facecolor.
  2. Create a JointGrid variable g:
  • Set the x parameter equals the 'bill_length_mm';
  • Set the y parameter equals the 'bill_depth_mm';
  • Set the hue parameter equals the 'species';
  • Set the 'viridis' palette;
  • Set the data.

Set the inside plot using the .plot_joint() function using the g variable:

  • Create a scatterplot using the seaborn;
  • Set the alpha parameter equals 0.5;
  • Set the 'pink' edgecolor parameter;
  • Set the linewidth parameter equals 1.

Set the outside plot using the .plot_marginals() function:

  • Create the histplot using the seaborn;
  • Add the kde parameter.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 5. Kapitel 3
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Opsummér dette kapitel

Explain code

Explain why doesn't solve task

close

Awesome!

Completion rate improved to 4.35

bookJointGrid

Stryg for at vise menuen

JointGrid is a figure-level function, when the function is called a JointGrid object is instantiated. The function creates a JointGrid object consisting of three axes objects but does not plot anything on it.

carousel-imgcarousel-imgcarousel-imgcarousel-imgcarousel-imgcarousel-img
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt

df = pd.read_csv('filename.csv')

# Creating the JointGrid variable
g = sns.JointGrid(x = 'column_name', y = 'column_name', data = df)

# Creating the inside plot
g.plot_joint(sns.scatterplot)

# Creating the outside plot
g.plot_marginals(sns.histplot)

plt.show()
Opgave

Swipe to start coding

  1. Set the 'ticks' style with the 'lightcyan' figure.facecolor.
  2. Create a JointGrid variable g:
  • Set the x parameter equals the 'bill_length_mm';
  • Set the y parameter equals the 'bill_depth_mm';
  • Set the hue parameter equals the 'species';
  • Set the 'viridis' palette;
  • Set the data.

Set the inside plot using the .plot_joint() function using the g variable:

  • Create a scatterplot using the seaborn;
  • Set the alpha parameter equals 0.5;
  • Set the 'pink' edgecolor parameter;
  • Set the linewidth parameter equals 1.

Set the outside plot using the .plot_marginals() function:

  • Create the histplot using the seaborn;
  • Add the kde parameter.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 5. Kapitel 3
single

single

some-alt