After taking a second look I think I might know you meant about using ylim.
group <- as.factor(group)
cond <- as.factor(cond)
bar=barchart(ratings~cond, groups = group,
auto.key = TRUE,
xlab = "Condition",
ylab = "Attraction Ratings",
main = "Attraction Ratings as a function of Condition and Group",
ylim = c(1:9),
scales=list(y=list(at=1:9, labels=1:9))
)
png("out.png")
print(bar); dev.off()
BTW: I it's generally a bad idea to use barcharts with non-zero values for the lower limit. It's a common way of "lying with statsitics" since it exaggerates differences.
I left my earlier guess in using the latticeExtra function yscale.components.subticks
:
library(latticeExtra)
bar=barchart(ratings~cond, groups = group,
auto.key = TRUE,
xlab = "Condition",
ylab = "Attraction Ratings",
main = "Attraction Ratings as a function of Condition and Group",
ylim = c(1:9), tck=c(5,1),
yscale.components=yscale.components.subticks
)
bar