थीम्स: शुरुआत से

ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

Rick Scavetta

Founder, Scavetta Academy

थीम्स लेयर

  • सभी non-data इंक
  • डेटा का भाग न होने वाले visual एलिमेंट्स
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

थीम्स लेयर

  • सभी non-data इंक
  • डेटा का भाग न होने वाले visual एलिमेंट्स

तीन प्रकार

प्रकार
text
line
rectangle
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

थीम्स लेयर

  • सभी non-data इंक
  • डेटा का भाग न होने वाले visual एलिमेंट्स

तीन प्रकार

type modified using
text element_text()
line element_line()
rectangle element_rect()
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

शुरुआती प्लॉट...

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) + 
  geom_jitter(alpha = 0.6)

ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

टेक्स्ट एलिमेंट्स


text
  axis.title 
    axis.title.x
      axis.title.x.top
      axis.title.x.bottom 
    axis.title.y
      axis.title.y.left
      axis.title.y.right 
  title 
    legend.title 
    plot.title
    plot.subtitle 
    plot.caption 
    plot.tag
  axis.text 
    axis.text.x 
      axis.text.x.top
      axis.text.x.bottom 
    axis.text.y
      axis.text.y.left
      axis.text.y.right
  legend.text
  strip.text
    strip.text.x
    strip.text.y
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

टेक्स्ट एलिमेंट्स

theme(
text, 
  axis.title, 
    axis.title.x,
      axis.title.x.top, 
      axis.title.x.bottom, 
    axis.title.y, 
      axis.title.y.left,
      axis.title.y.right, 
  title, 
    legend.title, 
    plot.title,
    plot.subtitle, 
    plot.caption, 
    plot.tag, 
  axis.text, 
    axis.text.x, 
      axis.text.x.top,
      axis.text.x.bottom, 
    axis.text.y, 
      axis.text.y.left, 
      axis.text.y.right,
  legend.text,
  strip.text, 
    strip.text.x, 
    strip.text.y)
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

थीम एलिमेंट्स एडजस्ट करना

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) + 
  geom_jitter(alpha = 0.6) +
  theme(axis.title = element_text(color = "blue"))

ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

शुरुआती प्लॉट...

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) + 
  geom_jitter(alpha = 0.6)

ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

लाइन एलिमेंट्स

theme(
line,
  axis.ticks,
    axis.ticks.x, 
      axis.ticks.x.top,
      axis.ticks.x.bottom,
    axis.ticks.y,
      axis.ticks.y.left, 
      axis.ticks.y.right,
    axis.line,
      axis.line.x, 
        axis.line.x.top,
        axis.line.x.bottom, 
      axis.line.y,
        axis.line.y.left, 
        axis.line.y.right, 
  panel.grid,
    panel.grid.major, 
      panel.grid.major.x, 
      panel.grid.major.y, 
    panel.grid.minor,
      panel.grid.minor.x,
      panel.grid.minor.y)
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

शुरुआती प्लॉट...

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) + 
  geom_jitter(alpha = 0.6)

ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

रेक्ट एलिमेंट्स

theme(
rect,
  legend.background, 
  legend.key,
  legend.box.background, 
  panel.background,
  panel.border,
  plot.background, 
  strip.background, 
    strip.background.x, 
    strip.background.y)
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

हायरार्किकल नामकरण इनहेरिटेन्स नियम दिखाता है

उदा. टेक्स्ट

text
  axis.title 
    axis.title.x
      axis.title.x.top
      axis.title.x.bottom 
    axis.title.y
      axis.title.y.left
      axis.title.y.right 

उदा. लाइन्स

line
  axis.ticks
    axis.ticks.x 
      axis.ticks.x.top
      axis.ticks.x.bottom
    axis.ticks.y
      axis.ticks.y.left,
      axis.ticks.y.right
    axis.line
      axis.line.x 
        axis.line.x.top
        axis.line.x.bottom
      axis.line.y
        axis.line.y.left 
        axis.line.y.right
ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

element_blank()

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) + 
  geom_jitter(alpha = 0.6) + 
  theme(line = element_blank(),
        rect = element_blank(),
        text = element_blank())

ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

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

ggplot2 के साथ डेटा विज़ुअलाइज़ेशन परिचय

Preparing Video For Download...