s-news
[Top] [All Lists]

reply summary for colored tick marks

To: s-news@lists.biostat.wustl.edu
Subject: reply summary for colored tick marks
From: Karen_Byron@bd.com
Date: Tue, 10 Jun 2008 10:55:13 -0400

I received two replies to my question on controlling the tick mark color.  Here is Bill Dunlap's solution (and slightly adapted example):
   plot(1:10, axes=F)
   x.lab <- c(1, 3, 7) ; lab <- c("One", "Three", "Seven") ;
   col<-c("red", "green", "blue") # works in 8.0, not earlier
   for(i in seq(along=x.lab))
      axis(side=1, at=x.lab[i], lab=lab[i], col.axis=col[i], fg=col[i])
The 'fg' was my missing piece.

Also helpful was the suggestion to use axis.render from Klaas Prins.  This is a lower level command that has more options.  Here is the same example reworked:
   plot(1:10, axes=F)
   x.lab <- c(1, 3, 7) ; lab <- c("One", "Three", "Seven") ;
   col<-c("red", "green", "blue") # works in 8.0, not earlier
   axis.render(side=1, ticks=list(at=x.lab, col.axis=col, fg=col, out.length = c(0.05, 0.03, 0.01)),
           labels=list(at=x.lab, text=lab, col.lab=col))

Thanks

Karen J Byron

Statistical Analysis


BD

1 Becton Drive, Franklin Lakes, NJ 07417 USA   MC: 078
tel: 201-847-5923
   fax: 201-847-5887
E-mail:
karen_byron@bd.com   Website: www.bd.com


******************************************************************* IMPORTANT MESSAGE FOR RECIPIENTS IN THE U.S.A.: This message may constitute an advertisement of a BD group's products or services or a solicitation of interest in them. If this is such a message and you would like to opt out of receiving future advertisements or solicitations from this BD group, please forward this e-mail to optoutbygroup@bd.com. ******************************************************************* This message (which includes any attachments) is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to the attorney-client privilege or other confidentiality protections. If you are not a designated recipient, you may not review, use, copy or distribute this message. If you received this in error, please notify the sender by reply e-mail and delete this message. Thank you. ******************************************************************* Corporate Headquarters Mailing Address: BD (Becton, Dickinson and Company) 1 Becton Drive Franklin Lakes, NJ 07417 U.S.A. *******************************************************************

<Prev in Thread] Current Thread [Next in Thread>
  • reply summary for colored tick marks, Karen_Byron <=