[R] Lattice: place ticks only on y-axis

marcel marcelcurlin at gmail.com
Thu Jul 21 17:56:04 CEST 2011


I am using lattice for a bar plot, having a little trouble removing ticks,
tick labels from x-axis, but keeping them on the y-axis. I looked around
quite a bit (http://tolstoy.newcastle.edu.au/R/e7/help/09/06/1733.html, help
pages, etc), tried variations of "scales = list(alternating = c(0,0)",
"scales = list(alternating = c(0,0), tck = c(0,0))" and others, couldn't
quite get it. 

#My code:
tC <- textConnection("
Time Type1 Type2 Type3
1.3 .50 .25 .25
4.5 .55 .25 .20
5.2 .65 .20 .15
")

data1 <- read.table(header=TRUE, tC)
data2 <- data.frame(Time=rep(data1$Time, 3), stack(data1[,2:4]))
close.connection(tC)
rm(tC)

require(lattice)
plot1<-xyplot(values ~ Time, scales = list(alternating = c(0,0), tck =
c(0,0)), group=ind, data=data2, stack=TRUE, horizontal=FALSE,
panel=panel.barchart, box.width=0.1,  axes=FALSE, ylim=c(-0.05,1.05),
xlim=c(0,6), main="Plot1")
print(plot1, position=c(0,0,1,.6))
 

--
View this message in context: http://r.789695.n4.nabble.com/Lattice-place-ticks-only-on-y-axis-tp3684094p3684094.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list