Skip to content

Need range01 function #8

@dicook

Description

@dicook

In converting from

temp.gly <- glyphs(nasa, "long", "day", "lat",
                   "ozone", height=2.5, 
                   y_scale = range01, polar = TRUE)
ggplot(temp.gly, ggplot2::aes(gx, gy, group = gid)) +
  geom_polygon(data=sth_america, 
            aes(x=long, y=lat, group=group), 
            fill="grey70") +
  add_ref_lines(temp.gly, color = "grey90") +
  add_ref_boxes(temp.gly, color = "grey90") +
  geom_path() +
  labs(x = "", y = "") +
  coord_map() +
  theme_map()  

to

ggplot() +
  geom_polygon(data=sth_america, 
           aes(x=long, y=lat, group=group), 
          fill="#014221", alpha=0.5, colour="#ffffff") +
  geom_glyph_box(data=nasa, aes(x_major = long, x_minor = day,
            y_major = lat, y_minor = ozone), fill=NA) +
  geom_glyph_line(data=nasa, aes(x_major = long, x_minor = day,
            y_major = lat, y_minor = ozone)) +
  geom_glyph(data=nasa, aes(x_major = long, x_minor = day,
            y_major = lat, y_minor = ozone), 
            y_scale = range01, polar = TRUE) +
  theme_map()

will throw an error. cubble is missing the range01 function, that will scale each spatial location data to range between 0 and 1, necessary to make polar glyphs with local scale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions