Dear r-users,

I want to draw dotplot for mtcars data according to cyl. There are three
types of cylinder 4,6,8. However when we draw it does not use 4,6,8 instead
label it as 1,2,3.

I have this code and would like to customise the tick mark according to cyl
groups:


dotplot(cyl ~ mpg, data = mtcars, groups = cyl, cex=1.2,axes=FALSE,
  main="Gas Milage for Car Models",  xlab="Miles Per Gallon")
ticks = c(1,2,3)
axis(2, at = ticks, labels=c(4,6,8))

I got this message:

axis(2, at = ticks, labels=c(4,6,8))
Error in axis(2, at = ticks, labels = c(4, 6, 8)) :
  plot.new has not been called yet

Thank you so much for any help given.
-- 
*Roslinazairimah Zakaria*
*Tel: +609-5492370; Fax. No.+609-5492766*

*Email: roslinazairi...@ump.edu.my <roslinazairi...@ump.edu.my>;
roslina...@gmail.com <roslina...@gmail.com>*
Faculty of Industrial Sciences & Technology
University Malaysia Pahang
Lebuhraya Tun Razak, 26300 Gambang, Pahang, Malaysia

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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