Facets लेयर

इंटरमीडिएट Data Visualization with ggplot2

Rick Scavetta

Founder, Scavetta Academy

Facets

  • सरल, पर उपयोगी
  • Small Multiples की अवधारणा
    • Edward Tufte द्वारा लोकप्रिय
    • Visualization of Quantitative Information, 1983
इंटरमीडिएट Data Visualization with ggplot2

इंटरमीडिएट Data Visualization with ggplot2

इंटरमीडिएट Data Visualization with ggplot2

iris.wide

p <- ggplot(iris.wide, aes(x = Length, 
                           y = Width, 
                           ccolorol = Part)) +
  geom_jitter(alpha = 0.7) +
  scale_color_brewer(palette = "Set1") +
  coord_fixed()

p

इंटरमीडिएट Data Visualization with ggplot2

iris.wide & facet_grid()

p <- ggplot(iris.wide, aes(x = Length, y = Width, color = Part)) +
  geom_jitter(alpha = 0.7) +
  scale_color_brewer(palette = "Set1") +
  coord_fixed()
p + facet_grid(cols = vars(Species))

इंटरमीडिएट Data Visualization with ggplot2

फॉर्मूला नोटेशन

p <- ggplot(iris.wide, aes(x = Length, y = Width, color = Part)) +
  geom_jitter(alpha = 0.7) +
  scale_color_brewer(palette = "Set1") +
  coord_fixed()
p + facet_grid(. ~ Species)

इंटरमीडिएट Data Visualization with ggplot2

iris.wide2

ggplot(iris.wide2, aes(x = Part, y = setosa, color = Measure)) +
  geom_jitter()
ggplot(iris.wide2, aes(x = Part, y = versicolor, color = Measure)) +
  geom_jitter()  
ggplot(iris.wide2, aes(x = Part, y = virginica, color = Measure)) +
  geom_jitter()

इंटरमीडिएट Data Visualization with ggplot2

iris.tidy

ggplot(iris.tidy, aes(x = Measure, y = Value, color = Part)) +
  geom_jitter() +
  facet_grid(cols = vars(Species))

इंटरमीडिएट Data Visualization with ggplot2

iris.tidy में गलत faceting:

ggplot(iris.tidy, aes(x = Measure, 
                      y = Value, 
                      color = Part)) +
  geom_jitter() +
  facet_grid(rows = vars(Species))

इंटरमीडिएट Data Visualization with ggplot2

अन्य विकल्प

  • पंक्तियों और कॉलम के अनुसार विभाजित करें
इंटरमीडिएट Data Visualization with ggplot2

अभ्यास करते हैं!

इंटरमीडिएट Data Visualization with ggplot2

Preparing Video For Download...