joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
220 stars 71 forks source link

No 'ylab' param in plot.xts #333

Closed jaymon0703 closed 4 years ago

jaymon0703 commented 4 years ago

Description

plot.xts does not have nor does it pass a ylab argument. Sure i can use title() after the plot function is called, but just wondering if you think ylab should be native to plot.xts() as it is in plot()?

Expected behavior

A little y label appears magically next to the y-axis.

Minimal, reproducible example

getSymbols("SPY",src = 'yahoo')
plot.xts(SPY$SPY.Adjusted, ylab="SPY")

Session Info

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 19.10

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.3.7.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] graphics  grDevices utils     datasets  stats     methods  
[7] base     

other attached packages:
[1] quantstrat_0.16.7          foreach_1.5.0             
[3] blotter_0.14.4             PerformanceAnalytics_2.0.4
[5] FinancialInstrument_1.3.1  quantmod_0.4.16.1         
[7] TTR_0.23-6                 xts_0.12-0                
[9] zoo_1.8-7                 

loaded via a namespace (and not attached):
 [1] quadprog_1.5-8   lattice_0.20-38  codetools_0.2-16
 [4] MASS_7.3-51.5    grid_3.6.2       curl_4.3        
 [7] boot_1.3-24      tools_3.6.2      iterators_1.0.12
[10] compiler_3.6.2  
joshuaulrich commented 4 years ago

I think it makes sense to include support for ylab. I'm sure you're not the only person who expected it, since it's exposed in plot() and plot.zoo().

I think we should also include support for sub and xlab. Though it may make sense that xlab throws a warning, since the x-axis is always time for xts objects.

It seems like this would be as simple as adding a title() call in chart.lines() if sub, xlab, or ylab are present in .... Thoughts?

jaymon0703 commented 4 years ago

Agreed on all points. Thanks for taking a look.

On Sat, May 9, 2020 at 8:40 AM Joshua Ulrich notifications@github.com wrote:

I think it makes sense to include support for ylab. I'm sure you're not the only person who expected it, since it's exposed in plot() and plot.zoo().

I think we should also include support for sub and xlab. Though it may make sense that xlab throws a warning, since the x-axis is always time for xts objects.

It seems like this would be as simple as adding a title() call in chart.lines() if sub, xlab, or ylab are present in .... Thoughts?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joshuaulrich/xts/issues/333#issuecomment-626170190, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBDTPBODWZWVIHWZW52RN3RQVFNNANCNFSM4M25D4PA .

joshuaulrich commented 4 years ago

Would you be willing to work on a PR? Please take a look at the contributing guide before you get started.

jaymon0703 commented 4 years ago

Sure, thanks

On Sat, May 9, 2020 at 8:50 AM Joshua Ulrich notifications@github.com wrote:

Would you be willing to work on a PR? Please take a look at the contributing guide https://github.com/joshuaulrich/xts/blob/master/.github/CONTRIBUTING.md before you get started.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joshuaulrich/xts/issues/333#issuecomment-626171407, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBDTPFD6F42FSCE2CNSGQDRQVGQ5ANCNFSM4M25D4PA .