# Hi all,
# I want to increase the line width of the plotted lines
# in a xy-lattice plot. My own attempts were all in vain.
# Without the group option the line width is modified -
# with the option it is funnily enough not.
# Please have a look at my syntax.
#
# Many thanks in advance
# Udo


############################################################

library(lattice)

data <- data.frame(cbind(1:2,c(1,1,2,2), c(0.5,0.9,1.0,1.8)))
names(data) <- c("BMI","time","Choline")

data$BMI <- factor(data$BMI)
levels(data$BMI) <- c("<=17.5",">17.5")
data$time <- factor(data$time)
levels(data$time) <- c("Admission","Discharge")


#Show names of settings
names(trellis.par.get())

#Try to set the line width of the two plotted colored lines
line<-trellis.par.get("plot.line")
line
line$lwd=3
trellis.par.set("plot.line", line)
line


#Without group option: Line width is changed
xyplot(Choline ~ time,
       data=data,
       type="l",
       scales=list(relation="free"),
       auto.key=list(title="BMI Group", border=FALSE),
       xlab=c("Point in Time"),
       ylab=c("Concentration of Choline"))

#With group option: Line width is not changed
xyplot(Choline ~ time,
       group=BMI,
       data=data,
       type="l",
       scales=list(relation="free"),
       auto.key=list(title="BMI Group", border=FALSE),
       xlab=c("Point in Time"),
       ylab=c("Concentration of Choline"))

______________________________________________
R-help@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.

Reply via email to