[R] Vertical Labels in plot graph - normally working fine but not on this graph

Berry Boessenkool berryboessenkool at hotmail.com
Fri Jul 8 14:43:10 CEST 2011



Hey Paolo,

you should specify las BEFORE you send the axis command.
It would also be good to set greater margins, this needs to be set before the entire plot, thus in following order:

par(las = 3, mar=c(6,2,2,2))
plot(ExtAvgCWV, ann=FALSE, xaxt="n", yaxt="n" )
axis(side =1 , at = tickplaces, labels = Labels)

If you only want to use las, you can also use this as an arument in the axis function.

HTH,
Berry

-------------------------------------
Berry Boessenkool
Potsdam
-------------------------------------


> Date: Fri, 8 Jul 2011 13:20:51 +0100
> From: statmailinglists at googlemail.com
> To: r-help at r-project.org
> Subject: [R] Vertical Labels in plot graph - normally working fine but not	on this graph
> 
> Hello,
> 
> I wonder if someone can elaborate on why in the first graph I am able to set
> labels vertical to the x-axis but not in the second.
> 
> I tried to select the window but it didnt really help.
> 
> 
> Many Thanks
> 
> Paolo
> 
> 
> 
> ExtAvgCWV = rnorm(200)
> ExtAvgDemand = rnorm(200)
> ExtGasDays =   seq(from = as.Date("2010-8-4", "%Y-%m-%d"), along.with =
> ExtAvgCWV, by = "days")
> plot(ExtAvgCWV, ann=FALSE, xaxt="n", yaxt="n" )
> tickplaces <-  seq( from = 1, by = 21, to = length(ExtGasDays))
> Labels = ExtGasDays[tickplaces]
> axis(side =1 , at = tickplaces, labels = Labels)
> par(las = 3)
> 
> windows()
> plot(ExtAvgDemand, ann=FALSE, xaxt="n", yaxt="n" )
> #dev.set(which = 4)
> axis(side =1 , at = tickplaces, labels = Labels)
> par(las = 3)
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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