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

Alexander Engelhardt alex at chaotic-neutral.de
Fri Jul 8 15:00:18 CEST 2011


Hey,

from what I see, you try to use the par(las=3) function after the plot 
command. You should use it before it, though. Somewhat liek this:

ExtAvgCWV = rnorm(200)
ExtAvgDemand = rnorm(200)
ExtGasDays =   seq(from = as.Date("2010-8-4", "%Y-%m-%d"), along.with =
ExtAvgCWV, by = "days")
op <- par(las = 3)
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(op)

X11() ## windows()
op <- par(las = 3)
plot(ExtAvgDemand, ann=FALSE, xaxt="n", yaxt="n" )
#dev.set(which = 4)
axis(side =1 , at = tickplaces, labels = Labels)
par(op)


Am 08.07.2011 14:20, schrieb Paolo Rossi:
> 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)



More information about the R-help mailing list