I cannot reproduce this as I don't have access to your data. Please create a minimal reproducible example for this to help me help you.
Trying similar code on the WWWusage
dataset works fine:
library(forecast)
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
trend <- seq_along(WWWusage)
fit1 <- auto.arima(WWWusage, d=0, xreg=trend)
fit2 <- auto.arima(WWWusage,d=1)
fc1 <- forecast(fit1, xreg=length(trend) + 1:10)
fc2 <- forecast(fit2, h=10)
autoplot(WWWusage) +
autolayer(fc2) +
autolayer(fc1)
Created on 2020-02-29 by the reprex package (v0.3.0)
Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 3.6.2 (2019-12-12)
#> os Ubuntu 18.04.4 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language en_AU:en
#> collate en_AU.UTF-8
#> ctype en_AU.UTF-8
#> tz Australia/Melbourne
#> date 2020-02-29
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date lib source
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.1)
#> backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1)
#> callr 3.4.1 2020-01-24 [1] CRAN (R 3.6.2)
#> cli 2.0.1 2020-01-08 [1] RSPM (R 3.6.2)
#> colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.6.1)
#> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.1)
#> curl 4.3 2019-12-02 [1] CRAN (R 3.6.1)
#> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.1)
#> devtools 2.2.1 2019-09-24 [1] CRAN (R 3.6.1)
#> digest 0.6.25 2020-02-23 [1] RSPM (R 3.6.2)
#> dplyr 0.8.4 2020-01-31 [1] RSPM (R 3.6.2)
#> ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.1)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.1)
#> fansi 0.4.1 2020-01-08 [1] RSPM (R 3.6.2)
#> farver 2.0.3 2020-01-16 [1] CRAN (R 3.6.1)
#> forecast * 8.11.0.9000 2020-02-22 [1] local
#> fracdiff 1.5-0 2019-12-09 [1] RSPM (R 3.6.1)
#> fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.1)
#> ggplot2 3.2.1 2019-08-10 [1] RSPM (R 3.6.1)
#> glue 1.3.1.9000 2020-02-22 [1] Github (tidyverse/glue@7131fc3)
#> gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.1)
#> highr 0.8 2019-03-20 [1] CRAN (R 3.6.1)
#> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.1)
#> httr 1.4.1 2019-08-05 [1] CRAN (R 3.6.1)
#> knitr 1.27 2020-01-16 [1] CRAN (R 3.6.1)
#> labeling 0.3 2014-08-23 [1] CRAN (R 3.6.1)
#> lattice 0.20-38 2018-11-04 [2] CRAN (R 3.6.2)
#> lazyeval 0.2.2 2019-03-15 [1] CRAN (R 3.6.1)
#> lifecycle 0.1.0 2019-08-01 [1] CRAN (R 3.6.1)
#> lmtest 0.9-37 2019-04-30 [1] CRAN (R 3.6.1)
#> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.1)
#> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.1)
#> mime 0.9 2020-02-04 [1] RSPM (R 3.6.2)
#> munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.1)
#> nlme 3.1-142 2019-11-07 [2] CRAN (R 3.6.2)
#> nnet 7.3-12 2016-02-02 [2] CRAN (R 3.6.2)
#> pillar 1.4.3.9000 2020-01-13 [1] Github (r-lib/pillar@8f5918c)
#> pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.1)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.1)
#> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.1)
#> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2)
#> processx 3.4.1 2019-07-18 [1] CRAN (R 3.6.1)
#> ps 1.3.0 2018-12-21 [1] CRAN (R 3.6.1)
#> purrr 0.3.3 2019-10-18 [1] CRAN (R 3.6.1)
#> quadprog 1.5-8 2019-11-20 [1] CRAN (R 3.6.1)
#> quantmod 0.4-15 2019-06-17 [1] CRAN (R 3.6.1)
#> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.1)
#> Rcpp 1.0.3 2019-11-08 [1] CRAN (R 3.6.1)
#> remotes 2.1.0 2019-06-24 [1] CRAN (R 3.6.1)
#> rlang 0.4.4.9000 2020-02-14 [1] Github (r-lib/rlang@4ca000c)
#> rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.1)
#> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.1)
#> scales 1.1.0 2019-11-18 [1] RSPM (R 3.6.1)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.1)
#> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.2)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.1)
#> testthat 2.3.1 2019-12-01 [1] CRAN (R 3.6.1)
#> tibble 2.1.3 2019-06-06 [1] RSPM (R 3.6.1)
#> tidyselect 1.0.0 2020-01-27 [1] RSPM (R 3.6.2)
#> timeDate 3043.102 2018-02-21 [1] CRAN (R 3.6.1)
#> tseries 0.10-47 2019-06-05 [1] CRAN (R 3.6.1)
#> TTR 0.23-6 2019-12-15 [1] RSPM (R 3.6.1)
#> urca 1.3-0 2016-09-06 [1] CRAN (R 3.6.1)
#> usethis 1.5.1.9000 2020-01-31 [1] Github (r-lib/usethis@7d8b066)
#> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.1)
#> xfun 0.12 2020-01-13 [1] RSPM (R 3.6.1)
#> xml2 1.2.2 2019-08-09 [1] CRAN (R 3.6.1)
#> xts 0.12-0 2020-01-19 [1] CRAN (R 3.6.1)
#> yaml 2.2.1 2020-02-01 [1] RSPM (R 3.6.2)
#> zoo 1.8-7 2020-01-10 [1] CRAN (R 3.6.1)
#>
#> [1] /home/mitchell/R/x86_64-pc-linux-gnu-library/3.6
#> [2] /opt/R/3.6.2/lib/R/library