| geom_glyph | R Documentation | 
Create glyph map with ggplot2
geom_glyph(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  ...,
  x_major = NULL,
  x_minor = NULL,
  y_major = NULL,
  y_minor = NULL,
  x_scale = identity,
  y_scale = identity,
  polar = FALSE,
  width = ggplot2::rel(2.1),
  height = ggplot2::rel(1.8),
  global_rescale = TRUE,
  show.legend = NA,
  inherit.aes = TRUE
)
geom_glyph_line(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  ...,
  x_major = NULL,
  x_minor = NULL,
  y_major = NULL,
  y_minor = NULL,
  polar = FALSE,
  width = ggplot2::rel(2.1),
  height = ggplot2::rel(2.1),
  show.legend = NA,
  inherit.aes = TRUE
)
geom_glyph_box(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  ...,
  x_major = NULL,
  x_minor = NULL,
  y_major = NULL,
  y_minor = NULL,
  polar = FALSE,
  width = ggplot2::rel(2.1),
  height = ggplot2::rel(2.1),
  show.legend = NA,
  inherit.aes = TRUE
)
mapping | 
 Set of aesthetic mappings created by   | 
data | 
 The data to be displayed in this layer. There are three options: If  A  A   | 
stat | 
 The statistical transformation to use on the data for this layer.
When using a  
  | 
position | 
 A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The  
  | 
... | 
 Other arguments passed on to  
  | 
x_major, x_minor, y_major, y_minor | 
 The name of the variable (as a
string) for the major and minor x and y axes. Together, each unique
combination of   | 
y_scale, x_scale | 
 The scaling function to be applied to each set of
minor values within a grid cell. Defaults to   | 
polar | 
 A logical of length 1, specifying whether the glyphs should
be drawn in polar coordinates.  Defaults to   | 
height, width | 
 The height and width of each glyph. Defaults to 95% of
the   | 
global_rescale | 
 Whether rescale is performed globally or on each individual glyph.  | 
show.legend | 
 logical. Should this layer be included in the legends?
  | 
inherit.aes | 
 If   | 
a ggplot object
print_p <- GGally::print_if_interactive
library(ggplot2)
# basic glyph map with reference line and box---------------
p <- ggplot(data = GGally::nasa,
       aes(x_major = long, x_minor = day,
           y_major = lat, y_minor = surftemp)) +
  geom_glyph_box() +
  geom_glyph_line() +
  geom_glyph() +
  theme_bw()
print_p(p)
# rescale on each individual glyph ---------------
p <- ggplot(data = GGally::nasa,
       aes(x_major = long, x_minor = day,
           y_major = lat, y_minor = surftemp)) +
  geom_glyph(global_rescale = FALSE)
print_p(p)
# adjust width and height with relative & absolute value ---------------
p <- ggplot() +
  geom_glyph(data = GGally::nasa,
             aes(x_major = long, x_minor = day,
                 y_major = lat, y_minor = surftemp),
                 width = rel(0.8), height = 1) +
   theme_bw()
print_p(p)
# apply a re-scaling on Y and use polar coordinate
p <-
  GGally::nasa |> 
  ggplot(aes(x_major = long, x_minor = day,
             y_major = lat, y_minor = ozone)) +
    geom_glyph_box(fill=NA) +
    geom_glyph_line() +
    geom_glyph(y_scale = GGally::range01, polar = TRUE)
print_p(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.