ggcnmap: China map based ggplot2 version 2

Description Usage Arguments Value Author(s) Examples

View source: R/ggcnmap.R

Description

China map based ggplot2 version 2

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ggcnmap(
  data,
  fill.variable = "Value",
  save = FALSE,
  low = "#3c9eff",
  high = "#ff445d",
  mid = "#f8d248",
  fill = 2,
  limits = c(4000, 19000),
  midpoint = 12000,
  breaks = c(5000, 8000, 11000, 14000, 17000)
)

Arguments

data

a data frame containing values to fill the provinces

fill.variable

a numeric vector

low

low color

high

high color

mid

the color of midpoint

limits

the range of fill variable

midpoint

the midpoint of fill variable

breaks

the breaks of fill variable

Value

a ggplot

Author(s)

ZhonghuiGai

Examples

1
2
3
4
5
6
7
8
data <- ggcnmap::province
library(showtext)
showtext_auto(enable = TRUE)
font_add('Songti', 'Songti.ttc','STKaiti','STXihei')
ggcnmap(data = data, fill.variable = "value", fill = 2,
        limits = c(40, 600),
        midpoint = 5,
        breaks = c(50, 80, 110, 140, 600))

ZhonghuiGai/ggcnmap documentation built on Dec. 18, 2021, 8:28 p.m.