Skip to content
Back to formatted view

Raw Message

Message-ID: <CADgEnDk=GdzZd1ySOAUKL1Hfs15jpo7+-SR9V=iAwy6JpXTQ5g@mail.gmail.com>
Date: 2015-04-07T16:30:53Z
From: Raghuraman Ramachandran
Subject: Unable to Scale/Display properly in plotting a xts/timeseries graph in a single plot

Dear guRus

I have xts data as:
str(volsA)
An ?xts? object on 2014-05-13/2015-04-07 containing:
  Data: num [1:221, 1:2] 18.8 18.5 18.4 22.2 22 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:2] "vol1" "vol2"
  Indexed by objects of class: [Date] TZ: UTC
  xts Attributes:
List of 1
 $ na.action:Class 'omit'  atomic [1:20] 1 2 3 4 5 6 7 8 9 10 ...
  .. ..- attr(*, "index")= num [1:20] 1.4e+09 1.4e+09 1.4e+09 1.4e+09
1.4e+09 ...
>
I am trying t0 plot them in a single frame but the scaling does not
happen properly.

plot(vols,plot.type="s",format="auto")
lines(vols[,2],col="red")

The lower graph in red gets displayed as a truncated graph and does
not fully exhibit the relationship. Can someone kindly help in
scaling/display please?

Thanks
Raghu