ZZWDoubleAxisBarPlusLinePlot: ZZWDoubleAxisBarPlusLinePlot

Description Usage Arguments Author(s) Examples

Description

ZZWDoubleAxisBarPlusLinePlot

Usage

1
2
ZZWDoubleAxisBarPlusLinePlot(raw_data, ylim_prim, ylim_sec, xlab = "x1",
  ylab_prim = "y1", ylab_sec = "y2", bar_fill = "dodgerblue")

Arguments

raw_data

data.frame. 1st column: numeric value of x axis; 2nd column: numeric value of prime y axis (left side); 3rd column: numeric value of second y axis (right side).

ylim_prim

the range of prime y axis

ylim_sec

the range of second y axis

xlab

the title of x axis, Default: 'x1'

ylab_prim

the title of prime y axis, Default: 'y1'

ylab_sec

the title of prime y axis, Default: 'y2'

bar_fill

the color of bar

Author(s)

Zhiwei Zhou

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(ggplot2)
raw_data <- tibble::tibble(
  Month = 1:12,
  Precip = c(49,36,47,41,53,65,81,89,90,84,73,55),
  Temp = c(-4,-4,0,5,11,15,16,15,11,6,1,-3)
)

ZZWDoubleAxisBarPlusLinePlot(raw_data = raw_data,
                             ylim_prim = c(0, 180),
                             ylim_sec = c(-4, 18),
                             xlab = "Month",
                             ylab_prim = "Precipitation",
                             ylab_sec = "Temperature") +
  scale_x_continuous("Month", breaks = 1:12)

JustinZZW/ZZWtool documentation built on March 7, 2020, 11:06 a.m.