Description Usage Arguments Value Note See Also Examples
View source: R/figure_calendar.R
Plot time series data in calendar way.
1 2 3 4 5 | fig_calendar(rawdata, colours = c("beige", "orange", "red", "darkred"),
alpha = 0.8, na.col = "grey80", val.col = "grey70",
mar.col = "grey80", mar.fill = "white", strip.text.size = 12,
strip.text.hjust = 0, axis.x.size = 10, isfull = F, islegend = T,
istext = F, text.size = 3, isday = F, day.size = 3)
|
rawdata |
A |
colours |
A |
alpha |
Numeric value between 1 and 0, controls the transparency of rects. |
na.col |
Colour of the NA values. |
val.col |
Border colour of the rects. |
mar.col |
Border colour of the rects, which used to fill blank space. |
mar.fill |
Colour used to fill the rects, which used to fill black space. |
strip.text.size |
Text size of strip. |
strip.text.hjust |
Horizontal position of the text in strip. |
axis.x.size |
Text size of axis x. |
isfull |
Boolean value, default FALSE,if TRUE use rects fill the blank space. |
islegend |
Boolean value, default TRUE, if FALSE remove the legend. |
istext |
Boolean value, default False, if TRUE draw the value to the correspond date. |
text.size |
Text size of data value. |
isday |
Boolean value, default FALSE, if TRUE draw the date number. |
day.size |
Text size of date number. |
ggplot object
istext
and isday
can only set one to be TRUE at one time.
Other figure: fig_bubble_rect
,
fig_event_line
,
fig_event_storm
, fig_parallel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # 1 month
rawdata <- data.frame(
dates = seq(as.Date('2018-01-01'), length.out = 20, by = '1 day'),
values = rnorm(20)
)
# fig_calendar(
# rawdata,
# na.col = 'grey90', val.col = 'grey80',
# mar.fill = 'white', mar.col = 'grey80',
# strip.text.size = 18, strip.text.hjust = 0.5,
# axis.x.size = 12, isfull = TRUE, islegend = FALSE
# )
# 6 months
num <- 180
# rawdata <- data.frame(
# dates = seq(as.Date('2018-01-01'), length.out = num, by = '1 day'),
# values = round(rnorm(num), 3)
# )
# fig_calendar(rawdata, isfull = TRUE, na.col = 'grey80', val.col = 'grey80',
# mar.fill = 'white', mar.col = 'grey80')
# add value tag
# fig_calendar(
# rawdata,
# na.col = 'grey90', val.col = 'grey80',
# mar.fill = 'white', mar.col = 'grey80',
# strip.text.size = 18, strip.text.hjust = 0.5,
# axis.x.size = 12, isfull = TRUE, islegend = FALSE,
# istext = TRUE
# )
#
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.