Re: [R] Labeling Dates of different length on two in axis plot

2019-08-25 Thread Ogbos Okike
Dear Bert and Jim, Here is the code: data <- read.table("CLMX.txt", col.names = c("year", "month", "day", "CLMX")) new.century <- data$year < 50 data$year <- ifelse(new.century, data$year + 2000, data$year + 1900) data$date <- as.Date(ISOdate(data$year, data$month, data$day)) x1 = data$date L

Re: [R] Labeling Dates of different length on two in axis plot

2019-08-25 Thread Ogbos Okike
Dear Jim and Bert, Thank your for looking into this for me. I will try to reproduce a part of my data and the plot I have. Data 1: 53 01 02 -1.28792560381641 53 01 06 -1.1854773963453 53 01 08 -1.55920165458006 53 01 15 -1.29196482429683 53 01 20 -1.06082194329819 53 01 22 -1.15430411152234 53 01

Re: [R] Labeling Dates of different length on two in axis plot

2019-08-25 Thread Bert Gunter
I think you will need to show us your code to get useful help (see the posting guide). A small subset of your data and a reprex may also be needed. R has several different graphics systems, and the answer depends on which you are using. In base graphics, the axis() function (see its Help page) may

Re: [R] Colouring selected columns in a facetted column chart

2019-08-25 Thread phil
Thank you so much for your help. Philip On 2019-08-25 03:54, Rui Barradas wrote: Hello, The code in Eric's answer works, but maybe it's better to redo the 'col' code. It's much simpler to create a factor with appropriate labels. Then, the values argument in scale_fill_manual can be set more

Re: [R] Labeling Dates of different length on two in axis plot

2019-08-25 Thread Jim Lemon
Hi Ogbos, Hope things are going well for you. Perhaps this is what you want: date_x1<-seq(as.Date("1953-01-02"),as.Date("2006-11-15"),length.out=8) value_x1<-sample(1000:5000,8) date_x2<-seq(as.Date("1957-07-26"),as.Date("1994-07-17"),length.out=6) value_x2<-sample(0:1000,6) plot(date_x1,value_x1,

Re: [R] Colouring selected columns in a facetted column chart

2019-08-25 Thread Rui Barradas
Hello, The code in Eric's answer works, but maybe it's better to redo the 'col' code. It's much simpler to create a factor with appropriate labels. Then, the values argument in scale_fill_manual can be set more naturally, it can depend on col. (I have also added a theme to make the axis labe