search for: x_yyyymmdd

Displaying 16 results from an estimated 16 matches for "x_yyyymmdd".

2018 May 07
0
Adding Year-Month-Day to X axis
Hi Greg, Easy: plot (x_yyyymmdd, y_duration, type="l", xaxt="n", yaxt="n", ylim=range(240,480)) abline (h=c(240,270,300,330,360,390,420,450,480,510,540), lty=2, lwd=1.0, col="grey40") axis(1,at=x_yyyymmdd,labels=format(x_yyyymmdd,"%Y-%m-%d")) axis(2,at=seq(240,480,by=60),labels=c(...
2018 May 07
2
Adding Year-Month-Day to X axis
...Thank you very much! How do I use the axis command for side=1 to label the x horizontal axis, in the format="%Y-%m-%d? style? Greg y_duration <- c (301.59050, 387.35700, 365.64366, 317.26150, 321.71883, 342.44950, 318.95350, 322.33233, 330.60333, 428.99516, 297.82066, 258.23166) x_yyyymmdd <-as.Date(c ("2018-04-25", "2018-04-26", "2018-04-27", "2018-04-28", "2018-04-29", "2018-04-30", "2018-05-01", "2018-05-02", "2018-05-03", "2018-05-04", "2018-05-05", "2018-05-06&qu...
2018 May 05
0
Adding Year-Month-Day to X axis
Hi Greg, What you are getting there is a factor, interpreted as a 1:n sequence based on the sort order of your "dates". Here's a way to get dates on your x-axis in the format you want: x_yyyymmdd<-as.Date(c("2018-04-25","2018-04-26","2018-04-27", "2018-04-28","2018-04-29","2018-04-30","2018-05-01","2018-05-02", "2018-05-03","2018-05-04","2018-05-05"),format="%Y-%m-%d"...
2018 May 07
2
Adding Year-Month-Day to X axis
Thanks. Regarding axis(1,at=x_yyyymmdd,labels=format(x_yyyymmdd,"%Y-%m-%d")) How do I get the text for YYYY-MM-DD to be drawn vertically, instead of horizontally? Greg > On May 6, 2018, at 11:54 PM, Jim Lemon <drjimlemon at gmail.com> wrote: > > axis(1,at=x_yyyymmdd,labels=format(x_yyyymmdd,"%Y-%m-%d&quo...
2018 May 05
4
Adding Year-Month-Day to X axis
...365.64366, 317.26150, 321.71883, 342.44950, 318.95350, 322.33233, 330.60333, 428.99516, 297.82066) plot (y_duration, type="l?) Adding Year-Month-Day values for the x axis, and then calling plot (x,y), yields a bizarre plot. Apparently, R does not understand my Year-Month-Day values. x_yyyymmdd <- c (2018-04-25, 2018-04-26, 2018-04-27, 2018-04-28, 2018-04-29, 2018-04-30, 2018-05-01, 2018-05-02, 2018-05-03, 2018-05-04, 2018-05-05) plot (x_yyyymmdd, y_duration, type="l") I would be enormously appreciative of your guidance. Greg Coats Virginia, USA [[alternative HTML version d...
2018 May 06
2
Adding Year-Month-Day to X axis
Jim, That you very much! How do I instruct staxlab to label once every n days, rather than labeling every day? Greg > On May 5, 2018, at 6:50 PM, Jim Lemon <drjimlemon at gmail.com> wrote: > > staxlab(1,at=x_yyyymmdd,labels=format(x_yyyymmdd,"%Y-%m-%d")) [[alternative HTML version deleted]]
2018 May 08
2
Adding Year-Month-Day to X axis
...within the graph?s border? Similar to the abline command I call below, in blue, for dashed horizontal lines, as a background grid. Greg y_duration <- c (301.59050, 387.35700, 365.64366, 317.26150, 321.71883, 342.44950, 318.95350, 322.33233, 330.60333, 428.99516, 297.82066, 258.23166, 282.01816) x_yyyymmdd <-as.Date(c ("2018-04-25", "2018-04-26", "2018-04-27", "2018-04-28", "2018-04-29", "2018-04-30", "2018-05-01", "2018-05-02", "2018-05-03", "2018-05-04", "2018-05-05", "2018-05-06&qu...
2018 May 08
0
Adding Year-Month-Day to X axis
abline (v=x_yyyymmdd, lty=3, lwd=1.0, col="blue") On Tue, May 8, 2018 at 5:23 PM, Gregory Coats <gregcoats at me.com> wrote: > Since the horizontal axis side=1 is year-month-day, how do I issue an > abline command to draw dashed vertical lines, as a background grid, within > the graph?s bord...
2018 May 05
1
Adding Year-Month-Day to X axis
...8, at 6:50 PM, Jim Lemon <drjimlemon at gmail.com> wrote: > > Hi Greg, > What you are getting there is a factor, interpreted as a 1:n sequence > based on the sort order of your "dates". Here's a way to get dates on > your x-axis in the format you want: > > x_yyyymmdd<-as.Date(c("2018-04-25","2018-04-26","2018-04-27", > "2018-04-28","2018-04-29","2018-04-30","2018-05-01","2018-05-02", > "2018-05-03","2018-05-04","2018-05-05"),format="%Y-%m-...
2018 May 06
0
Adding Year-Month-Day to X axis
...labels that would overlap. When you have labels that are all the same length, this usually results in every second, or third, or fourth label being displayed. So you can probably get what you want by not using staxlab. However, if you really want to use staxlab, try this: oddones<-seq(1,length(x_yyyymmdd)-1,by=2) staxlab(1,at=x_yyyymmdd[oddones], labels=format(x_yyyymmdd,"%Y-%m-%d")[oddones]) It will also work with plain "axis", which is what you seem to want. Jim
2018 May 07
0
Adding Year-Month-Day to X axis
Look at par(las=2) in the graphics package. You will almost certainly have to increase the bottom margin, e.g.: par(mar=c(6,4,4,2) to accomodate the vertical labels. Jim On Mon, May 7, 2018 at 2:11 PM, Gregory Coats <gregcoats at me.com> wrote: > Thanks. Regarding > axis(1,at=x_yyyymmdd,labels=format(x_yyyymmdd,"%Y-%m-%d")) > > How do I get the text for YYYY-MM-DD to be drawn vertically, instead of > horizontally? > Greg > > On May 6, 2018, at 11:54 PM, Jim Lemon <drjimlemon at gmail.com> wrote: > > axis(1,at=x_yyyymmdd,labels=format(x_yyyym...
2018 May 08
1
Adding Year-Month-Day to X axis
...do not see any difference between the x versus y plot drawn in blue, and the y only plot drawn in red. Is the correct? Greg y_duration <- c (301.59050, 387.35700, 365.64366, 317.26150, 321.71883, 342.44950, 318.95350, 322.33233, 330.60333, 428.99516, 297.82066, 258.23166, 282.01816, 280.00000) x_yyyymmdd <-as.Date(c ("2018-04-25", "2018-04-26", "2018-04-27", "2018-04-28", "2018-04-29", "2018-04-30", "2018-05-01", "2018-05-02", "2018-05-03", "2018-05-04", "2018-05-05", "2018-05-06&qu...
2018 May 05
0
Adding Year-Month-Day to X axis
...018, at 6:50 PM, Jim Lemon <drjimlemon at gmail.com> wrote: > > Hi Greg, > What you are getting there is a factor, interpreted as a 1:n sequence > based on the sort order of your "dates". Here's a way to get dates on > your x-axis in the format you want: > > x_yyyymmdd<-as.Date(c("2018-04-25","2018-04-26","2018-04-27", > "2018-04-28","2018-04-29","2018-04-30","2018-05-01","2018-05-02", > "2018-05-03","2018-05-04","2018-05-05"),format="%Y-%m-...
2018 May 09
1
Adding Year-Month-Day to X axis
...do not see any difference between the x versus y plot drawn in blue, and the y only plot drawn in red. Is the correct? Greg y_duration <- c (301.59050, 387.35700, 365.64366, 317.26150, 321.71883, 342.44950, 318.95350, 322.33233, 330.60333, 428.99516, 297.82066, 258.23166, 282.01816, 280.00000) x_yyyymmdd <-as.Date(c ("2018-04-25", "2018-04-26", "2018-04-27", "2018-04-28", "2018-04-29", "2018-04-30", "2018-05-01", "2018-05-02", "2018-05-03", "2018-05-04", "2018-05-05", "2018-05-06&qu...
2018 May 08
0
Adding Year-Month-Day to X axis
Hi Greg, This is because both plots have equally spaced x values. To see the difference, try this: plot (x_yyyymmdd, y_duration, type="l", xaxt="n", yaxt="n", ylim=range(240,480), xlab="", ylab="", col="blue") axis(1) plot ( y_duration, type="l", xaxt="n", yaxt="n", ylim=range(240,480), xlab="", ylab=&q...
2018 May 09
0
Adding Year-Month-Day to X axis
...do not see any difference between the x versus y plot drawn in blue, and the y only plot drawn in red. Is the correct? Greg y_duration <- c (301.59050, 387.35700, 365.64366, 317.26150, 321.71883, 342.44950, 318.95350, 322.33233, 330.60333, 428.99516, 297.82066, 258.23166, 282.01816, 280.00000) x_yyyymmdd <-as.Date(c ("2018-04-25", "2018-04-26", "2018-04-27", "2018-04-28", "2018-04-29", "2018-04-30", "2018-05-01", "2018-05-02", "2018-05-03", "2018-05-04", "2018-05-05", "2018-05-06&qu...