Bug 7930 - Wishlist: axis( ) could take vector of colors
Summary: Wishlist: axis( ) could take vector of colors
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Wishlist (show other bugs)
Version: old
Hardware: All All
: P5 normal
Assignee: Jitterbug compatibility account
URL:
Depends on:
Blocks:
 
Reported: 2005-06-11 02:22 UTC by Jitterbug compatibility account
Modified: 2005-06-11 19:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2005-06-11 02:22:47 UTC
From: Elizabeth Purdom <epurdom@stanford.edu>
Hi,
This is not a bug, but a simple enhancement suggestion: that axis( ) also 
allow option "col" to take a vector of colors equal to the length of 
"labels". Currently it allows it, in the sense that there is no error 
message, but the function will use just the first element of the vector.

Example
 > plot(1:5,exp(1:5),axes=F,type="o")
 > axis(1,col=c(rep("red",2),rep("blue",3)))
gives all red axis notation.

Thanks,
Elizabeth Purdom
(Windows XP, R 2.1.0)

Comment 1 Jitterbug compatibility account 2005-06-11 19:18:58 UTC
From: Uwe Ligges <ligges@statistik.uni-dortmund.de>
epurdom@stanford.edu wrote:

> Hi,
> This is not a bug, but a simple enhancement suggestion: that axis( ) also 
> allow option "col" to take a vector of colors equal to the length of 
> "labels". Currently it allows it, in the sense that there is no error 
> message, but the function will use just the first element of the vector.
> 
> Example
>  > plot(1:5,exp(1:5),axes=F,type="o")
>  > axis(1,col=c(rep("red",2),rep("blue",3)))
> gives all red axis notation.


A color of length > 1 does not make sense here, from my point of view. 
Hence I'd like to object here.
It might make sense for argument "col.axis", but this is very hard to 
implement due to the internal structure of automatical tick mark 
calculations.

Most easily you can use mtext() to annotate an un-annotated axis with 
different colors as in:

  plot(1:10, xaxt="n")
  axis(1, at=c(2,5,8), labels=rep("", 3))
  mtext(c(2,5,8), side=1, at=c(2,5,8),
        col=c("red", "green", "blue"), line=0.5)


Uwe Ligges



> Thanks,
> Elizabeth Purdom
> (Windows XP, R 2.1.0)
> 
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

Comment 2 Jitterbug compatibility account 2005-06-12 22:36:35 UTC
Audit (from Jitterbug):
Sun Jun 12 17:36:35 2005	thomas	moved from incoming to wishlist