Reputation: 6784
Here is a reproducible example:
library(xts)
constr.month.ts<-structure(c(5114.14, 2684.58, 6974.38, 6935.93, 3543.58, 33073.07,
8292.42, 18612.79, 9305.35, 7449.95, 23619.85, 76292.39, 2461.65,
10412.17, 69125.81, 3983.8, 8310.06, 41309.99, 7967.86, 14090.79,
34324.36, 14703.94, 57256.19, 122629.83, 539.7, 5595.65, 52425.89,
34090.27, 18597.61, 43133.51, 50044.64, 24416.35, 37564.54, 47467.72,
35315.63, 95817.74, 8477.28, 22719.4, 28389.55, 36987.2, 17535.29,
44724.55, 9911.84, 53962.46, 25183.81, 27610.91, 27216.94, 48955.66,
13979.56, 7287.34, 22234.38, 14414.43, 20087.2, 18910.02, 19331.26,
16552.08, 18319.97, 6364.54, 27689.13, 52966.76, 208.12, 10888.74,
12694.57, 19398.1, 7042.34, 6866.65, 8685.48, 5689.97, 5790.28,
8965.91, 3100.03, 48924.71, 1358.89, 13742.76, 8267.89, 35099.2,
15977.01, 17338.4, 13166.29, 8146.65, 8098.93, 9448.07, 8878.93,
22057.95, 722.72, 4864.02, 4991.31, 6987.43, 2318.44, 47601.72,
6944.43, 2779.62, 4331.18, 11003.15, 5313.1, 26783.29, 522.68,
5521.02, 4880.33, 9313.16, 3214.67, 8980.91, 23046.09, 15698.68,
8147.7, 16896.7, 25409.96, 41303.58, 4389.25, 0, 29231.19, 28087.86,
9315.08, 17372.04, 16833.7, 21343.68, 4512.8, 9618.17, 19171.28,
55794.29, 6855.21, 8583.31, 18337.2, 34689.21, 11893.71, 25079.03,
15638.56, 32321.35, 6845.77, 19872.21, 12361.9, 94009.41, 6.09,
1268.67, 36323.04, 30750.09, 1744.15, 15738.23, 25677.51, 24835.04,
4179.83), .Tsp = c(2006, 2017.66666666667, 12), class = "ts")
constr.annual.ts <- aggregate(constr.month.ts)/12
This plot looks ok
plot(as.xts(constr.month.ts), ylab="", xlab="", main="My Title",las=0,cex.axis=1.1,cex.main=0.9)
But in that one y-axis labels are not ok. How can i fix them?
plot(as.xts(constr.annual.ts), ylab="", xlab="",main= "My Title",las=0,cex.axis=1.1,cex.main=0.9)
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Greek_Greece.1253 LC_CTYPE=Greek_Greece.1253
[3] LC_MONETARY=Greek_Greece.1253 LC_NUMERIC=C
[5] LC_TIME=Greek_Greece.1253
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xts_0.10-0 zoo_1.8-0
loaded via a namespace (and not attached):
[1] compiler_3.4.2 grid_3.4.2 lattice_0.20-35
Upvotes: 2
Views: 428
Reputation: 30455
It must have been a bug. Install the development version, from github, to fix it.
devtools::install_github("joshuaulrich/xts")
Upvotes: 1