Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ FacetGrid | Multi-Plot Grids
Deep Dive into the seaborn Visualization
セクション 5.  1
single

single

bookFacetGrid

メニューを表示するにはスワイプしてください

The time to learn the cool plots we were talking about!

A useful approach to exploring medium-dimensional data is by drawing multiple instances of the same plot on different subsets of your dataset.

FacetGrid object takes a DataFrame as input and the names of the variables that will form the grid's row, column, or hue dimensions. The variables should be categorical, and the data at each level of the variable will be used for a facet along that axis.

carousel-imgcarousel-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 FacetGrid variable
g = sns.FacetGrid(df, col = 'column_name', row = 'row_name')

# The main approach for visualizing data on this grid is with the FacetGrid.map() method
g.map(sns.scatterplot, 'column_name')

plt.show()
タスク

スワイプしてコーディングを開始

  1. Set the 'whitegrid' style with the 'cornsilk' axes.facecolor.

  2. Create a FacetGrid variable g:

  • Set the data for the FacetGrid;
  • Set the col parameter equals the 'day';
  • Set the row parameter equals the 'smoker';
  • Set the height parameter equals 3.

Implement the .map() function to build histplots:

  • Create histplots;
  • Set the 'olive' color for the histplots;
  • Add the kde parameter;
  • Disable the fill parameter;
  • Set the binwidth equals 4;
  • Display the plot.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 5.  1
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt