[R] unordered y axis
Jim Lemon
drj|m|emon @end|ng |rom gm@||@com
Thu Nov 7 04:15:31 CET 2019
Hi Ani,
There are a number of ways to modify this sort of plot. Here is one:
x11(width=7,height=5)
par(cex.axis=.8)
plot(month~year,xaxt="n", type="l", ylab="Month", xlab="Year",
main="Month of occurrence in year")
axis(1,at=seq(1981,2014,3))
library(plotrix)
boxed.labels(year,month,month.abb[month],border=NA,cex=0.7)
Jim
On Thu, Nov 7, 2019 at 1:24 PM ani jaya <gaaauul using gmail.com> wrote:
>
> Dear R-Help,
>
> I have 35 data that is month when the annual minima happened. So I want to
> plot those data but the order of y axis is not from 1 to 12, but let say
> start from 9,10,11,12,1,..8. The reason to do this is when 12 (Dec) meet 1
> (Jan) in the following year the graph is not quite good (for me).
>
>
> year<-c(1981:2015)
> month<-c(3, 1, 12, 11, 2, 1, 12, 1, 2, 1, 12, 3, 2, 12, 2, 7, 2, 6, 2, 1,
> 1, 12, 3, 12, 3, 12, 2, 2, 9, 2, 1, 4, 12, 3, 4)
> plot(month~year,xaxt="n", type="b", ylab="Month", xlab="Year")
> axis(1, at=1986:2015,cex.axis=.8)
>
>
> Any lead or comment is appreciate.
>
> Best, Ani
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list