search for: contourplot

Displaying 20 results from an estimated 96 matches for "contourplot".

2010 Jun 08
1
add one point to contourplot()
Hi All, I want to add one point to contourplot().  I used contourplot() in my code like contourplot(z ~ a + b |c, data) I understand there is plot.axes argument for filled.contour(), but it  did not work for my code. I also tried plot() and text() for contourplot(), but got this error: "plot.new has not been called yet" Any suggestion...
2007 Jan 29
1
overlay xyplot on contourplot in lattice in R
Hi everybody, I want to do a contourplot in lattice with my raw data overlaid on it(xyplot) which seemed to be a very easy thing to do. I've tried it in many ways, but I haven't succeeded at obtaining it. let's say x, y, and z as the variables that comes from the data frame ''ex'': therefore my countourplot...
2010 Jul 10
1
contourplot by year
Hi - I have a dataframe with 4 variables - long, lat, temp and year. I would like to plot temperature by lat and long in contour plots by year. There are 391 data points. When I try contourplot(temp~long*lat|year,data=hake,cuts=10,labels = TRUE,contour = TRUE,pretty = TRUE,region=TRUE) I get plots with dots around by data, but not contour lines or filled in regions. I have also used the intrep function with image and contour which works fine, but I have to subset by data by year first...
2004 Aug 06
1
: (Lattice): Overlaying more than one trend surface using contourplot() and wireframe()
Hi, Is there a way to plot more than one trend surface using the functions contourplot() and wireframe(). I have found an add=T in contour(), but no equivalent argument in contourplot() and wireframe()? I have taken the example 11-2 (pages 441-451) from Design and analysis of experiments (Montgomery 2001, 5th edition) to see if this could be done in R. I have managed to plot ind...
2003 Jul 27
1
contourplot:how to get it to label all contours like 'contour'
Hi, one of the nice things about contour is that it labels all contour lines. contourplot only labels each particular elevation a single time. i.e., if there are two contour lines corresponding to z = 45, it will only label one of them. is there a way to get contourplot to automatically label all the contour lines, even those that are repeated? i ask because i want to plot contour p...
2007 May 20
1
lattice contourplot error
Hello, A weird thing is happening to me. I have a 128x128 elements matrix m with values between 0 and 1. If I do: R> library(lattice) R> contourplot (m, cuts=9) I get the following error message: Error in validDetails.text(x) : Invalid 'rot' value The same for any cuts >9. I can plot m with contourplot(m, cuts=8) but this is not detailed enough. The 'normal' R image and contour commands work just fine so it seems there is no...
2008 Dec 03
1
how do I eliminate excess levels in lattice contourplot key / legend?
I'm working on a contourplot( ) graph, the subject of several previous posts to this list. The contours express probabilities from 0 - 1, but the key that is automatically generated by contourplot pads the probability scale with values that are impossible (i.e, range goes from -0.2 to 1.2), which will be confusing to those...
2006 Feb 10
1
the proper way to use panel functions in lattice package?
Hi, I was trying to stack a topographic map readed in from esri shapefile with a contour map and a vector map. However, the plotMap(maptools) and contourplot(lattice) do not seem to work well on top of each other. Here is part of my code. xrange<-range(225000:350000) yrange<-range(2685000:2810000) basemap <- read.shape("Twn25_town_dxf_Polygon.shp") plot.Map(basemap,xlim=xrange,ylim=yrange,fg=0,ol=8,xlab=&q...
2013 Feb 14
1
Clip a contour with shapefile while using contourplot
...R("shape", layer="Export_Output_4") ## Project the shapefile to the UTM 16 zone proj4string(hello) <- CRS("+proj=utm +zone=16 +ellps=WGS84") ## Read Contour data mydata <- read.csv("mydata.csv") head(mydata ) summary(mydata) #Create a contourplot contourplot(Salinity ~ Eastings+Northings | Time, mydata, cuts=30,pretty=TRUE) Thank you so much. I would welcome any other ways to do this aside from contourplot and lattice. Best Regards, Janesh [[alternative HTML version deleted]]
2007 Sep 07
1
contourplot lines, text, and mtext
If I have a contourplot (in the lattice package) and I want to add straight lines to it, how do I do this? I see that there are llines() and lsegement() functions for lattice plots, but they don't seem to do anything in this case: library(lattice) library(KernSmooth) x=rnorm(10000) y=x+rnorm(x,0,.5) a=bkde2D(cbind...
2009 Apr 16
1
weird error with contourplot
Sorry if I am cluttering up this list with too many rank beginner questions. But I *am* a rank beginner, and I am at my wit's end with this one: I have a data frame df, with components x,y,z. This command to make a contour plot with lattice graphics works just fine: > contourplot(z~x*y,data=df,cuts=20) Then I try > contourplot(z~x*y,data=df,cuts=20,region=T) And it dies on me with the error: Error in unit(x, default.units) : 'x' and 'units' must have length > 0 I have done maybe a hundred contour plots in this same exact way, and have never seen...
2006 Jan 12
1
Equal number of cuts in a contourplot with trellis
...mple: library(lattice) g <- expand.grid(x = 60:100, y = 1:25, ti = c("a","b","c")) g$z <-with(g, (-1e-4*x-1e-3*y-1e-5*x*y)*(ti=="a") + (1e-2*x-1e-3*y-1e-4*x*y)*(ti=="b") + (1e-3*x-1e-3*y-1.e-5*x*y)*(ti=="c") ) contourplot(z~ x * y|ti, data = g, cuts=20, pretty=T, screen = list(z = 30, x = -60)) As you can see in the figure, most of the contour lines are in one of the levels and we are not able to see how the other levels look like. I would like to display the same number of cuts...
2004 May 02
1
contourplot, xyplot, aspect ratio, mfrow
Hi, I am gradually moving from the classical R plot functions to the library Lattice I have some questions about contourplot () and its arguments: 1/ I am working on geographical coordinates which makes necessary that the X (longitude) and Y (latitude) units be represented with the same distance on screen. This was obtained in the classical R plots with plot.default(x,y, asp=1,...) and then contour(..., add=T). When I...
2008 Nov 24
2
lattice contourplot background covers inward-facing ticks
I wish to have inward-pointing ticks on my contourplot graph, but the colored background produced by the "region=TRUE" statement covers the ticks up, is there any way around this? Sample code below. --Seth library(lattice) model <- function(a,b,c,d,e, f, X1,X2) # provide model function for contour plot {J <- a + (b*X1) +...
2009 Apr 06
1
contourplot label color
...i everyone, I am new to the list. My problem is to change the color of the label in a contour plot. The plot is quite dark and I'd like to have the line and label white, it works for the line with a simple "col", but for the labels I need to pass throught a panel call and : > contourplot(Prob ~ D.CSW * D.CS,data=grid,region=TRUE,col="white",panel=function(x,y,z,...){panel.contourplot(...,labels=list(col="white"),...)}) give me the answer "the argument 'label' may correspond to other variables" (I translate the error message from my french v...
2010 Dec 20
1
contourplot help
Hello I'm using the following call to create a contourplot: library(lattice) m <- as.matrix(read.table("data.txt")) contourplot(m[,3] ~ m[,2] * -m[,1], at = c(1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1), scales = list(x = list(log = 10, labels = c("1", "10", "100&quo...
2006 Jan 25
0
Log-Likelihood 3d-plot and contourplot / optim() starting values
...following loglikelihood-function # Log-Likelihood-Funktion loglik_jm<-function(N,phi,t) { n<-length(t) i<-seq(along=t) s1<-sum(log(N-(i-1))) s2<-phi*sum((N-(i-1))*t[i]) n*log(phi)+s1-s2 } # the data t<-c(7,11,8,10,15,22,20,25,28,35) # now i want to do a 3d-plot and a contourplot in order to see at which values of N and phi the loglikelihood function becomes zero. # i do this in order to get an idea where the starting values for a optimization for the mle of N could be # 3dplot and contourplot phi<-seq(0,1,length=50) N<-seq(101,110,length=50) z<-outer(N,phi,logl...
2007 Dec 13
2
Overlaying trellis xyplot on contourplot
Friends: I wish to overlay data points on a contour graph. The following example produces a nice contour plot, but I have not mastered the concept of using panel functions to modify plots. Can someone show me how to overlay the data points (given after contour plot statement) on the contourplot? --Seth model <- function(a,b,c,X1,X2) # provide model function for contour plot {(exp(a + b*X1 + c*X2)) / (1 + exp(a + b*X1 + c*X2))} g <- expand.grid(X1 = seq(0.40, 0.8,0.01), X2 = seq(0.03,0.99,0.03)) # create gridded data for contour plot a <- -37.61...
2011 Sep 30
1
need help with contourplot figure
...1 and there are both a tick mark and a number label at the X-axis values of 0.2,0.4,0.6. and 0.8. I want to add tick marks to the figure at every 0.1 value. This will help a viewer determine the values on the x axis. I included all of my code. I apologize but it is very long. I am created a contourplot figure that will be a jpg. I also included my notes after the # sign so you can see what I am doing. Any help would be greatly appreciated. jpeg(file="C:/Documents and Settings/Michael/My Documents/Mike/amberjack/Reefs_Model/YPRlevel.jpg", width=8,height=8, unit="in",...
2009 Mar 25
2
need help with ordering of plots
...ur plots, 4 in all. The data is coming from a data frame named "nd.frame", which has elements "xdf", "ydf", "zdf", and "pndt". I am treating "pndt" as a factor, and it has four levels. I make a call to the lattice graphics routine "contourplot" like so: contourplot(zdf~xdf*ydf|factor(pndf),data=nd.frame) >From this I get a 2x2 grid of four contour plots. So far so good. The problem - a big problem in my situation - is that the arrangement is in the order 3 | 4 ------ 1 | 2 What I need is 1 | 2 ------...