similar to: How to reverse colors in filled.contour?

Displaying 20 results from an estimated 8000 matches similar to: "How to reverse colors in filled.contour?"

2006 Jun 27
3
how to rotate a triangle image(ZMAT) ?
Hello R users... how to align this Zmat (triangle image) in X axis? I would like that the triangle's base become in the X axis and the triangle's height become in the Y axis Is there some trick for make this? Thanks. Cleber ######################## my test and try f <- function(x,y){ z=1-x-y z[ z < (-1e-15) ] <- NA return( -100*x+0*y+100*z ) } x = seq( 1, 0,
2011 Jul 12
1
spatial logit help
Please I am new to R. I got the following code from a friend:   gmat <- cbind(gmat,p*(1-p)*wxb) for (j in seq(1:ncol(gmat))) {   gmat[,j] <- fitted(lm(gmat[,j]~zmat)) }   It is for spatial logit.   After defining all the matrices in it such as P, wxb, gmat, and zmat, I tried to run it in R and got the following error message: Error in model.frame.default(formula = gmat[, j] ~ zmat,
2011 Oct 13
2
how to plot two surfaces with lattice::wireframe
Hi all, I'd like to plot the Real and Imaginary parts of some f(z) as two different surfaces in wireframe (the row/column axes are the real and imag axes). I know I can do it by, roughly speaking, something like plotz <- expand.grid(x={range of Re(z)}, y={range of Im(z), groups=1:2) plotz$func<-c(Re(f(z),Im(f(z)) wireframe(func~x*y,data=plotz,groups=groups) But that seems like a
2007 Nov 23
1
complex conjugates roots from polyroot?
Hi, All: Is there a simple way to detect complex conjugates in the roots returned by 'polyroot'? The obvious comparison of each root with the complex conjugate of the next sometimes produces roundoff error, and I don't know how to bound its magnitude: (tst <- polyroot(c(1, -.6, .4))) tst[-1]-Conj(tst[-2]) [1] 3.108624e-15+2.22045e-16i
2006 Jun 25
1
Puzzled with contour()
Folks, The contour() function wants x and y to be in increasing order. I have a situation where I have a grid in x and y, and associated z values, which looks like this: x y z [1,] 0.00 20 1.000 [2,] 0.00 30 1.000 [3,] 0.00 40 1.000 [4,] 0.00 50 1.000 [5,] 0.00 60 1.000 [6,] 0.00 70 1.000 [7,] 0.00 80 0.000 [8,] 0.00 90
2008 Aug 30
1
Unable to send color palette through plot.Design to method="image"
I have been trying to specify a different color palette to the image method in plot.Design. My model has crossed two rcs() arguments and one two-level gender argument. The goal which appears to have been mostly achieved is to produce separate bivariate plots for men and women The call to plot does produce a level plot but it appears only with the default color palette despite various
2005 Jan 13
1
how to use solve.QP
At the risk of ridicule for my deficient linear algebra skills, I ask for help using the solve.QP function to do portfolio optimization. I am trying to following a textbook example and need help converting the problem into the format required by solve.QP. Below is my sample code if anyone is willing to go through it. This problem will not solve because it is not set up properly. I hope I
2023 Jul 23
2
col2rgb() function
Hello I have a palette vector of colour blind colours (in hexadecimal) which I?m using for plots, but they are not see-through, and as I wanted to overlay some histograms I wanted to convert these colours to rgb, when you can set the opacity. I have found the function col2rgb(), which works in the sense that it gives a vector of numbers but these don?t work directly in rgb because they are too
2008 Jul 03
2
Plotting Prediction Surface with persp()
Hi all I have a question about correct usage of persp(). I have a simple neural net-based XOR example, as follows: library(nnet) xor.data <- data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0))) names(xor.data) <- c("x","y","o") xor.nn <- nnet(o ~ x + y, data=xor.data, linout=FALSE, size=1) # Create an (x.y) surface and predict over all points d <-
2012 Apr 03
1
A contour plot question - vis.gam () function in "mgcv"
Hi, Please see the attached contour plot (I am sorry about the big file). This was created using the vis.gam() function in "mgcv" package. However, my question is somewhat broader. In generating this figure, I first created the contours using vis.gam() and then I plotted the points. These point are plotted on top of the contours so that some of the contour lines are only partially
2008 Mar 13
2
Plot contour over filled contour
Dear R-users, I haven't found a way in the searchable archive to overplot a contour (lines) over a surface. I have a (n,m) matrix that represents sea surface temperature that I have plotted using image.plot(), filled.contour() or image(). I would like to overplot this image with some contour lines of mixed layer depth values(same size matrix). How can I do this? Any help is appreciated,
2011 Aug 31
1
unequal bins in filled.contour
Hello, I am trying to plot SADIE red-blue plots of cluster indicies using filled.contour. I want a plot which only has three bins for the data: <-1.5, -1.5 - 1.5, >1.5, but I am having trouble getting there. example X1 X2 X3 X4 X5 1 -5 -4.5 1.0 4.5 6 2 -3 -2.0 1.2 -1.0 3 3 0 0.0 0.0 -0.5 -1 4 -2 -3.0 1.0 1.5 3 5 -6 -2.0 0.5 3.0 2 example<-as.matrix(example)
2023 Jul 23
2
col2rgb() function
Thanks That works nicely Nick On Sun, 23 Jul 2023 at 19:26, Ben Bolker <bbolker at gmail.com> wrote: > Does adjustcolor() help? > > cb8<- c("#000000", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", > "#D55E00", "#CC79A7") > plot(0,0,xlim=c(1,8),ylim=c(0,1)) >
2009 Nov 19
2
plot filled.contour over continent map
Dear all, As a newbie in R I would like to do the following (simple?) thing: to plot a filled.contour plot over a map showing country boundaries (e.g. for Europe) What i do is: map('worldHires',xlim=c(-10,40),ylim=c(35,70),boundary = TRUE,border=0.1) map.axes() filled.contour(mslp, zlim=c(1000,1020),color.palette = colorRampPalette(c("blue", "white",
2023 Jul 23
1
col2rgb() function
Does adjustcolor() help? cb8<- c("#000000", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", "#D55E00", "#CC79A7") plot(0,0,xlim=c(1,8),ylim=c(0,1)) points(1:8,rep(0.5,8),col=cb8,pch=19,cex=2) points(1:8,rep(0.75,8),col=adjustcolor(cb8, alpha.f = 0.3), pch=19,cex=2) On 2023-07-23 2:15 p.m., Nick Wray
2010 Jun 06
2
Color scale graphic
Hello Recently, I've been dealing with a seemingly simple problem. I have a table with two columns filled with values from a test I made (say, amount of precipitation and Months measured). Now, instead of plotting a typical linear graphic with precipitation on the y-axis and the months in the x-axys, I would like to "convert" the values of precipitation in a color gradient,
2006 Dec 17
1
Draw a circle on a filled.contour() plot
Hi all, I'm trying to use symbols() to draw a circle of a given radius at a given position onto a filled.contour() plot. The commands I issue are: > filled.contour(y,x,z,levels=seq > (0.02,1.0,len=50),color.palette=colorRampPalette(c > ("blue","yellow","red")),title=title(main="",xlab="",ylab="")) >
2010 Nov 05
1
filled.contour colorbar without black color separators?
Dear list members, I have been using filled.contour in order to plot EEG data. For the colors, I used a conventional ramp from blue to red (blue - green - yellow - red), and 100 color levels to make the plot looking smooth: (...) color.palette = colorRampPalette(c('blue','green', 'yellow','red'), space='rgb'), nlevels = 100 (...) My problem ist that
2012 Oct 03
2
Legend Truncated Using filled.contour
Hey everyone, I'm working on a contour plot depicting asymptomatic prevalence at varying durations of infectiousness and force of infection. I've been able to work everything out except for this one - my legend title keeps getting cut off. Here's what I have: filled.contour(x=seq(2,30,length.out=nrow(asym_matrix)), y=seq(1,2,length.out=ncol(asym_matrix)), asym_matrix, color =
2007 Jan 01
4
Help with filled.contour()
The following plot is a first approximation to what I need: *********************************** mu1 <- 0 mu2 <- 5 s <- 1 x <- seq(-2.5, 7.5, length = 41) y <- seq(-2.5, 2.5, length = 41) f <- function(x,y){ term1 <- 1/(2*pi*sqrt(s*s)) term2 <- -1/2 term3 <- (x - mu1)^2/s term4 <- (y - mu1)^2/s term5 <- (x - mu2)^2/s term1*(.5 * exp(term2*(term3 + term4)) + .5 *