rjdverse / rjdemetra

R interface to JDemetra+ v 2.x
https://rjdverse.github.io/rjdemetra
52 stars 16 forks source link

plotting SI ratios #60

Closed duncanelliott closed 4 years ago

duncanelliott commented 4 years ago

S3 method for class 'decomposition_X11'

plot(x, first_date, last_date, caption = "S-I ratio", ...)

would be useful for the default to set ylim=range(x$si_ratio)

I found with multiplicative decomposition that the range was something like c(0.8,1.2) which was too large for analysing my particular series. Also ylim argument didn't appear to work

AQLT commented 4 years ago

By default the ylim is set as followed:

y_min <- min(d8, d10)
y_max <- max(d8, d10)
ylim <- c(y_min - abs(y_min)*0.2, y_max + abs(y_max)*0.2)

Do you think it is better to change this default value? In the last PR, I've added a ylim parameter functions:

library(RJDemetra)
mysa <- x13(ipi_c_eu[, "FR"], spec = c("RSA5c"))
plot(mysa$decomposition)

plot(mysa$decomposition, ylim = c(-32, 12))

Created on 2019-10-13 by the reprex package (v0.3.0)