knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(ggplot2)
library(fhiplot)

Points

q <- ggplot(diamonds[1:200,], aes(carat, depth, color = cut))
q <- q + geom_point(size = 4)
q <- q + fhiplot::scale_color_fhi(palette = "primary")
q <- q + labs(title="Theme: 'theme_fhi_basic'")
q <- q + fhiplot::theme_fhi_basic()
q
q <- ggplot(diamonds[1:200,], aes(carat, depth, color = cut))
q <- q + geom_point(size = 4)
q <- q + fhiplot::scale_color_fhi(palette = "primary")
q <- q + labs(title="Theme: 'theme_fhi_lines'")
q <- q + fhiplot::theme_fhi_lines()
q
q <- ggplot(diamonds[1:200,], aes(carat, depth, color = cut))
q <- q + geom_point(size = 4)
q <- q + fhiplot::scale_color_fhi(palette = "primary")
q <- q + labs(title="Theme: 'theme_fhi_lines_horizontal'")
q <- q + fhiplot::theme_fhi_lines_horizontal()
q

Barcharts

We first try some barcharts with the dis_primary palette and two different themes:

q <- ggplot(diamonds, aes(x=color, fill = cut))
q <- q + geom_bar()
q <- q + fhiplot::scale_fill_fhi(palette = "primary")
q <- q + labs(title="Theme: 'theme_fhi_basic'")
q <- q + fhiplot::theme_fhi_basic()
q
q <- ggplot(diamonds, aes(x=color, fill = cut))
q <- q + geom_bar()
q <- q + fhiplot::scale_fill_fhi(palette = "primary")
q <- q + labs(title="Theme: 'theme_fhi_lines'")
q <- q + fhiplot::theme_fhi_lines()
q
q <- ggplot(diamonds, aes(x=color, fill = cut))
q <- q + geom_bar()
q <- q + fhiplot::scale_fill_fhi(palette = "primary")
q <- q + labs(title="Theme: 'theme_fhi_lines_horizontal'")
q <- q + fhiplot::theme_fhi_lines_horizontal()
q


folkehelseinstituttet/fhiplot documentation built on March 25, 2022, 7:59 a.m.