search for: mycolor

Displaying 20 results from an estimated 31 matches for "mycolor".

Did you mean: mycolors
2008 Jan 01
2
Alignment and Labeling of a color key in a xyplot?
...rtically printed and located to the right of the color key. I tried to give the 'key' argument in 'draw.colorkey' some arguments, but I could not manage to put a label on the color key. Thanks very much. Marius library(lattice) library(grid) x=c(1,2,3) colorseq=c(0.2,0.5,0.8) mycolors=gray(colorseq) #trellis.device(postscript,horizontal=F,onefile=F,file="~/testplot.ps") xyplot(x~x,col=mycolors,aspect=1) draw.colorkey(key=list(at=seq(1,3,length=4),col=mycolors,text=list(c ("test"))),draw=TRUE,vp=viewport(x=1,y=0.6,height=0.8)) #dev.off()
2008 Oct 07
2
panel.groups: use group.number to define colors
...<- factor(rep(c("cos", "sin", "id", "square"), each=100)) > fact2 <- factor(rep(c("periodic", "not periodic"), each=100)) > > my.df <- data.frame(x=x, y=y, fact = fact, fact2 = fact2) > > head(my.df) > > > myColors <- c(2, 4) > > xyplot(y ~ x | fact, data = my.df, groups = fact2, > panel = panel.superpose, > panel.groups = function(..., group.number) { > > panel.xyplot(...) > #panel.xyplot( ..., col=myColors[group.number]) # error > > })...
2012 Feb 03
1
incomplete final line found on <name of my sourced function file>
...} } nr.of.dates<-length(myagg[[datesvar]]); index<-seq(1,nr.of.dates,2) par(bg = "white") plot(x=myagg[[datesvar]],y=myagg[,2],ylim=c(ymin,ymax),col=all.colors[1],type='l', ylab=mymetric,xlab="",lwd=2,xaxt='n',yaxt='n',main=mytitle) mycolors<-1 for(i in 2:length(invars)){ mycolors<-c(mycolors,(i)) } axis(1, labels =format(as.Date(myagg[[datesvar]][index], origin="1970-01-01"), "%Y-%m-%d"), at=myagg[[datesvar]][index], las=2,cex.axis=0.8) axis(2, labels=seq(ymin,ymax,by=mystep),at=seq(ymin,ymax,...
2010 Aug 13
1
Lattice: Superimposing histograms with different colors and transparency effects
....histogram(x,...) panel.mathdensity(dmath=dnorm,args = list(mean=mean(x),sd=sd(x)),...) }) Besides transparency, I get no filling colors at all in the, even though plot.polygon and superpose.polygon parameters are set. I clearly need to define my own colors with alpha channel set: mycolors = rgb(c(228, 55, 77), c(26, 126, 175), c(28, 184, 74),alpha = 50,maxColorValue = 255) ... and include 'mycolors' as an explicit argument in the histogram function: histogram(~x ,groups=grouping, type = "density",ylim=c(0,.45), panel = "pan...
2006 Jul 10
2
Setting the colors of lines in a trellis plot...
.... I've managed to make the key use the colors I want. I've managed to make the symbols of the actual plot use the colors I want. But I have been unable to find the correct incantation to make the lines of the actual plot use the colors I want. Here's the relevant section of code: mycolors <- c("black", "darkgreen", "red") mylines <- Rows(superpose.line, 1:numlines); mylines$col <- mycolors mysymbols <- Rows(superpose.symbol, 1:numlines); mysymbols$pch <- c(15:18)[1:numlines] mysymbols$col <- mycolors print(xyplot(...
2009 Nov 26
1
Adding text in the panels for Trellis plot ...
...uot;, length(columns)) > j <- 0 > for (i in columns) + { + plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2],ylab = "Frequency", + xlab = "Score", xlim = c(1,5), ylim = c(0,100),layout=c(3,1), + main = c(colnames(data)[i],"index",j+1),mycolors = colors()[c(536,552,652,254,26)], + panel = function(..., col, mycolors) { + panel.histogram(..., col = mycolors[panel.number()])}) + trellis.focus('strip', 1, 1, highlight=FALSE) + ltext(0.60, -0.25, 'PPM', col='blue', pos=3) + trellis.unfocus() + } Error in...
2009 Mar 13
5
Selecting / creating unique colours for behavioural / transitional data
Dear all, This seems like a simple problem but i've searched the help files and tried various options but failed, so apologies in advance for asking what i'm sure is an easy thing to do! In short, I have displayed behavioural data using the TraMineR package such that there is a colour change between the transition of behaviours, however, all the methods that i have used thus far have
2016 Apr 16
0
Mean of hexadecimal numbers
Since these are color strings, you can use functions in the grDevices package (other others) to manipulate them. E.g., you can convert them to various color spaces and perhaps use the mean in one of those spaces as your 'average color'. > myColors <- c(One="#FF7C00",Two="#00BF40",Three="#FFFF00") > col2rgb(myColors) One Two Three red 255 0 255 green 124 191 255 blue 0 64 0 > rgb2hsv(col2rgb(myColors)) One Two Three h 0.08104575 0.3891798 0.166666...
2012 Aug 15
4
boxplot help
Hi, im a newbie with very wobbly coding abilities. Tearing my hair out over getting the boxplot i want... I have a dataset called 'eagle' which consists of year (2011 or 2012), month (jan - dec), roof (TT6, TT13 or BARE) and temp (the continuous variable that i want to plot). So i want boxplots of the three roof treatments in every month organised in chronical order along x axis 2011 -
2008 Aug 25
1
lattice : using both strip and strip.left
...gt; df <- melt( data.frame(x=x, one=y1, two=y2, condition1=factor(c("a", > "b")), condition2=factor(c("1","1", "2", "2"))), > id=c("x", "condition1", "condition2")) > > # custom colors > myColors <- c( "#E41A1C", "#377EB8") > > # here is the ggplot2 version > p <- qplot(x,value, data=df, facets = condition1 ~ condition2, > colour=variable) > p <- p + scale_colour_manual(values = myColors) > print(p) > > # lattice version > lattice.o...
2017 Nov 12
2
create waveform sawtooth
...?s not all: as frequencies increase, it appears that wavelengths increase to infinite length, then get shorter again as the wave reverses, then it gets longer and flips again. Here?s a small file that demonstrates the bad sawtooth waves: library(tuneR) sample_rate <- 12000 reverse <- FALSE mycolors=c("red","orange","yellow","green","cyan","blue","violet","magenta") plot(sawtooth(110,duration=round(sample_rate/100),samp.rate=sample_rate,xunit="samples")@left,type="l") freqs <- c(111,112,113,...
2016 Apr 16
2
Mean of hexadecimal numbers
... and if you need to convert back: ?as.hexmode -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Apr 16, 2016 at 8:20 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > ?strtoi > > You'll have to remove
2003 Oct 29
1
Wishlist: user-specified color names for palette() (PR#4836)
Full_Name: Hsiu-Khuern Tang Version: 1.8.0 OS: GNU/Linux (Debian unstable) Submission from: (NULL) (156.153.255.243) Hi, I use palette(rgb(red=..., green=..., blue=..., names=mycolors)) to define my own color palette. After doing this, the names `mycolors' are not stored in palette() anymore, so that palette() returns a mix of built-in color names and RGB values. Eg: > palette() [1] "black" "#EAA200" "#FF6633" "gray60" I wish...
2016 Apr 16
1
Mean of hexadecimal numbers
Hm..., Should these two versions produce the same solution? Unfortunately and shame to confess, I don't know much about the colors in R: myColors <- c("#FF7C00","#00BF40","#FFFF00") Colors=rgb2hsv(col2rgb(myColors)) apply(Colors,1,mean) h s v 0.2122974 1.0000000 0.9163399 * * * * * # Average the 1st two by taking the middle colour of a 3 colour palette x <- colorRampPalette(c(&...
2008 Aug 01
0
standardize ggplot and lattice themes
...ple? Best wishes, baptiste > library(ggplot2) > library(lattice) > > # example data > x <- seq(0, 10, len = 100) > y1 <- jitter(sin(x), 1000) > y2 <- 0.5*jitter(cos(x), 1000) > > # custom colors > greyDark <- grey(0.5) > greyLight <- grey(0.9) > myColors <- c( "#E41A1C", "#377EB8") > palette(myColors) > > # here is the ggplot2 version > df <- melt(data.frame(x=x, one=y1, two=y2), id="x") > p <- qplot(x,value, data=df,colour=variable, linetype=variable, > main="ggplot2 (almost) default...
2015 May 31
2
Etiquetas en gráfico de dispersión
Buenas tardes, Tengo un gráfico de dispersión y quiero indicar cada punto a qué individuo corresponde. ¿Cómo añado estas etiquetas de datos? El código es: res<-cmdscale(fst,k=2) plot(res[,1],res[,2],lwd=2,xlab="x",ylab="y") abline(h=0,v=0,col="blue") Muchas gracias, Gemma [[alternative HTML version deleted]]
2017 Nov 12
0
create waveform sawtooth
...appears that wavelengths increase >to infinite length, then get shorter again as the wave reverses, then >it gets longer and flips again. > >Here?s a small file that demonstrates the bad sawtooth waves: > >library(tuneR) > >sample_rate <- 12000 >reverse <- FALSE >mycolors=c("red","orange","yellow","green","cyan","blue","violet","magenta") >plot(sawtooth(110,duration=round(sample_rate/100),samp.rate=sample_rate,xunit="samples")@left,type="l") >freqs <- c(111,...
2016 Apr 16
0
Mean of hexadecimal numbers
On 16/04/2016 8:47 AM, Atte Tenkanen wrote: > Hi, > > How would you calculate the "mean colour" of several colours, for > example c("#FF7C00","#00BF40","#FFFF00")? > Bert answered your subject line question. Your text is asking something else: if those are colours, you don't want to treat each of them as a single integer. A
2009 Nov 30
4
Is there a way to convert rgb/hex value to a (nearest) color name?
Hi all, I'm trying to convert a series of rgb codes into a color name. What is my easiest option? So far I'm stuck with just converting to hex using rgb() and I know R knows a number of colours() but a mapping of the two has failed me. Any help in this regard will be highly appreciated. Regards, George
2009 Nov 23
3
Trellis Plot
anyone know how to add text in the Trellis plot panel ?? i want to add things eg: dot dot dot. in the headrer of the panel. eg: http://old.nabble.com/file/p26486579/hist1.png hist1.png -- View this message in context: http://old.nabble.com/Trellis-Plot-tp26486579p26486579.html Sent from the R help mailing list archive at Nabble.com.