[R-SIG-Finance] [R-sig-finance] Plot TS-matrix as a surface

Jeff Ryan jeff.a.ryan at gmail.com
Thu Feb 26 18:13:11 CET 2009


PS,

I have been working on adding a chartSeries3d function to quantmod.
The code isn't in place yet, but it relies on persp, and some extra
manipulation to offer much better axis labeling.  It is designed for
xts/zoo structures in particular.  The final code will work for any
time-series.

This should be in the next release of quantmod, but I've posted the
alpha code and a .png here:

http://www.quantmod.com/example/chartSeries3d

HTH,
Jeff


R/Finance 2009: Applied Finance with R
April 24, 25 2009 Chicago, IL USA
http://www.RinFinance.com


On Thu, Feb 26, 2009 at 8:20 AM, R at Nabble <vlanschot at yahoo.com> wrote:
>
> Thank you Enrico. Your example helped me to solve a (embarrasingly basic)
> error in my code.
>
> Plots fine now.
>
> Thx again.
>
> PS
>
> Enrico Schumann wrote:
>>
>> it should be helpful to give a little code example, or at least the
>> content
>> of the error messages that you received.
>>
>> the following gives me a perspective plot...
>>
>> require(zoo)
>> nC     <- 10  # columns
>> nO     <- 100 # observations
>> dataM  <- array(runif(nC * nO), dim=c(nO, nC))
>> zz     <- zoo(dataM, 1:nO)
>> persp(1:nO,1:nC,zz)
>>
>>
>> regards
>> enrico
>> -----Ursprüngliche Nachricht-----
>> Von: r-sig-finance-bounces at stat.math.ethz.ch
>> [mailto:r-sig-finance-bounces at stat.math.ethz.ch] Im Auftrag von R at Nabble
>> Gesendet: Donnerstag, 26. Februar 2009 12:26
>> An: r-sig-finance at stat.math.ethz.ch
>> Betreff: [R-SIG-Finance] [R-sig-finance] Plot TS-matrix as a surface
>>
>>
>> I'd like to be able to plot a time-series matrix (i.e. first col contains
>> sorted dates, rest of cols contains non-sorted data, with headings at the
>> top; current format is as a zoo object) as a surface/3D chart. The
>> function
>> persp() is giving me errors, even if I transform data as core data, etc.
>>
>> Any suggestions / other functions available?
>>
>> Thx,
>>
>> PS
>> --
>> View this message in context:
>> http://www.nabble.com/Plot-TS-matrix-as-a-surface-tp22222236p22222236.html
>> Sent from the Rmetrics mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>>
>>
>> 06:40:00
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Plot-TS-matrix-as-a-surface-tp22222236p22225107.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list