I am trying to have very neat plots. So, trying to removes the whites spaces between the plots. I am using the timetk
library. I have seen some of the examples related to the same questions, but those queries are mostly from grid.arrange or command +theme(plot.margin = unit(c(-0.25,0.5,-0.25,0.5), "lines"))
from ggplot library. These concepts do not work on some of the plots commands with timetk library.
When there will be many plots, I want to have very neet plots.
My codes are
library(tidyverse)
library(timetk)
## Case 1
walmart_sales_weekly %>%
group_by(Store, Dept) %>%
plot_anomaly_diagnostics(Date, Weekly_Sales,
.facet_ncol = 3,
.interactive = TRUE)
## Case 2
walmart_sales_weekly %>%
select(Date, Weekly_Sales,Size, Temperature,Fuel_Price, CPI, Unemployment )%>%
pivot_longer(-Date)%>%
group_by(name) %>%
plot_seasonal_diagnostics(.date_var = Date,
.value = value,
.feature_set = 'month.lbl',
.facet_vars = name
)
## Case 3
walmart_sales_weekly %>%
select(Date, Weekly_Sales,Size, Temperature,Fuel_Price, CPI, Unemployment )%>%
pivot_longer(-Date)%>%
group_by(name) %>%
plot_time_series(.date_var = Date,
.value = value,
.facet_ncol = 2, .smooth = FALSE
)
I required timeseries plots with tiketk library. I do not like to use any other library