[R-sig-eco] wmtsa

Glen A Sargeant gsargeant at usgs.gov
Mon May 19 17:14:14 CEST 2008


plot.wavCWT() accepts the argument "col" to plot, so you need to supply a 
vector of color specifications.

The following code shows an easy way to specify colors for a looong vector

#Example data
x <- rnorm(1000,0,1)

#Number of colors to use
n.colors = 10 

#We will use colors interpolated between these;
#will shade from chocolate to tan to green
color.scheme = c("chocolate", "tan", "green4")

#Save old color palette settings
oldPalette <- palette()

#Reset color palette to have 10 levels shaded as specified
#above
newPalette <- colorRampPalette(color.scheme, space = "Lab")
palette(newPalette(n.colors))

#Cut x into 10 bins; you could use different criteria
#for grouping x values; I used deciles
n.cuts <- n.colors + 1
cuts <- quantile(x, seq(from = 0, to = 1, length.out = n.cuts))
bins <- cut(x, cuts)

#Use bin indices to index color scheme
color <- as.numeric(bins)

#Plot the data
plot(x,pch=19,col=color)

#Reset to the original color scheme
palette(oldPalette)


*************************************************
Glen A. Sargeant, Ph.D.
Research Wildlife Biologist/Statistician
Northern Prairie Wildlife Research Center
8711 37th Street SE
Jamestown, ND  58401

Phone: (701) 253-5528
E-mail:  glen_sargeant at usgs.gov
FAX:     (701) 253-5553
*************************************************



"stephen sefick" <ssefick at gmail.com> 
Sent by: r-sig-ecology-bounces at r-project.org
05/19/2008 08:41 AM

To
r-sig-ecology at r-project.org
cc

Subject
[R-sig-eco] wmtsa






I would like to change the wavCWT (package wmtsa) plot colors does anyone
know how to do this.

d = wavCWT(x)# I can provide data but it is a rather large data set
plot(d) #default color scheme does not have enough contrast

thanks

Stephen

-- 
Let's not spend our time and resources thinking about things that are so
little or so large that all they really do for us is puff us up and make 
us
feel like gods. We are mammals, and have not exhausted the annoying little
problems of being mammals.

-K. Mullis

                 [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list