Categorical Plot Types

Visualisasi Data Lanjutan dengan Seaborn

Chris Moffitt

Instructor

Categorical Data

  • Data which takes on a limited and fixed number of values
  • Normally combined with numeric data
  • Examples include:
    • Geography (country, state, region)
    • Gender
    • Ethnicity
    • Blood type
    • Eye color
Visualisasi Data Lanjutan dengan Seaborn

Plot types - show each observation

Each observation categorical plots

Visualisasi Data Lanjutan dengan Seaborn

Plot types - abstract representations

Abstract categorical plots

Visualisasi Data Lanjutan dengan Seaborn

Plot types - statistical estimates

Statistical categorical plots

Visualisasi Data Lanjutan dengan Seaborn

Plots of each observation - stripplot

sns.stripplot(data=df, y="DRG Definition",
              x="Average Covered Charges",
              jitter=True)

stripplot example

Visualisasi Data Lanjutan dengan Seaborn

Plots of each observation - swarmplot

sns.swarmplot(data=df, y="DRG Definition",
              x="Average Covered Charges")

swarmplot example

Visualisasi Data Lanjutan dengan Seaborn

Abstract representations - boxplot

sns.boxplot(data=df, y="DRG Definition",
            x="Average Covered Charges")

boxplot example

Visualisasi Data Lanjutan dengan Seaborn

Abstract representation - violinplot

sns.violinplot(data=df, y="DRG Definition",
               x="Average Covered Charges")

violinplot example

Visualisasi Data Lanjutan dengan Seaborn

Abstract representation - boxenplot

sns.boxenplot(data=df, y="DRG Definition",
              x="Average Covered Charges")

boxenplot example

Visualisasi Data Lanjutan dengan Seaborn

Statistical estimates - barplot

sns.barplot(data=df, y="DRG Definition", 
            x="Average Covered Charges",
            hue="Region")

barplot example

Visualisasi Data Lanjutan dengan Seaborn

Statistical estimates - pointplot

sns.pointplot(data=df, y="DRG Definition", 
              x="Average Covered Charges",
              hue="Region")

pointplot example

Visualisasi Data Lanjutan dengan Seaborn

Statistical estimates - countplot

sns.countplot(data=df, y="DRG_Code", hue="Region")

countplot example

Visualisasi Data Lanjutan dengan Seaborn

Let's practice!

Visualisasi Data Lanjutan dengan Seaborn

Preparing Video For Download...