search for: xrange

Displaying 20 results from an estimated 72 matches for "xrange".

Did you mean: range
2009 Sep 17
1
Beginner Q- dates in the xrange?
Hi all- terribly beginner question here, but I can't figure out how to put dates as the values for my x range in a plot. Example: xrange <- results$current yrange <- results$DIFF plot(xrange, yrange, type="n", xlab="Date", ylab="Differential") lines(results$DIFF, type="l", lwd=1.5, col="red") Where xrange is: > xrange [1] "2010-04-12" "2010-04-14" &qu...
2001 Jul 20
2
plot() axis problem
This posting just illustrates the problem with plot() x<-1:20 y<-c(1:10,301:310) plot(x,y) xrange<-c(1,10) plot(x,y,xlim=xrange) #uses ylim=range(y) This is the default behaviour of plot() and I think it is not sensible. By default the range of the y axis should span the y values corresponding to the points plotted. In this example the yaxis should span 1-10 rather than 1-310. This does the...
2009 Mar 06
1
help to use ppp in spatial analysis
...in square area without problems and the scale is adequate to visual analysis of points ploted. But if i try to use ppp function to create a point pattern the result appears in rectangle area with a poor scale, dificulting in this case the analysis of the points. I think that is probably because of xrange and yrange parameter of ppp function, that was calculated based on max and min values of both x and y, but i am not sure: latitude <- dataset$V2 longitude <- dataset$V3 xrange <-c(min(longitude), max(longitude)) yrange <-c(min(latitude), max(latitude)) area <- ppp(longitude/10000,...
2011 Nov 28
1
plotting multiple lines on single graph ggplot2
Hello everyone I have some data of the following type. 100 200 300 400 500 1.1 1.2 1.3 1.4 1.5 600 700 800 900 1000 1.5 1.7 1.9 2.0 2.4 With plot() and points functions I can plot these 4 lines of data. But I dont know how to do it with qplot or ggplot functions. The scenario is something like this: the hundreds should appear on x-axis and the fractional values of y axis. Thanks alot. MEMON
2013 Jul 16
1
Masking oceans using polypath
...the ocean from an image plot I have made. Here is some example code: library(mapdata) image(x=110:155, y =-40:-10, z = outer(1:45, 1:30, "+"), xlab = "lon", ylab = "lat") outline <- map("worldHires", plot=FALSE) # returns a list of x/y coords xrange <- range(outline$x, na.rm=TRUE) # get bounding box yrange <- range(outline$y, na.rm=TRUE) xbox <- xrange + c(-2, 2) ybox <- yrange + c(-2, 2) # create the grid path in the current device polypath(c(outline$x, NA, c(xbox, rev(xbox))), c(outline$y, NA, rep(ybox, each=2)),...
2009 Nov 30
3
bug or bizarre feature?
Hello, I'm running into a very strange problem: > xrange <- c(-2.5,2.5) > xdim <- 100 > mobility <- 0.1 > slope <- 1.16 > urange <- slope*xrange > udim <- max(slope*xdim,5) > du <- (urange[2]-urange[1])/udim > uvec <- urange[1]+(1:udim-0.5)*du > # type dependent weight functi...
2006 Sep 28
3
complex plots using layout()
...=========================================== x <- demog$age y1 <- demog$mji y2 <- demog$nles xhist <- hist(x, plot=FALSE) y1hist <- hist(y1, plot=FALSE) y2hist <- hist(y2, plot=FALSE) top1 <- max(c(xhist$counts, y1hist$counts)) top2 <- max(c(xhist$counts, y2hist$counts)) xrange <- range(x,na.rm=TRUE) y1range <- range(y1,na.rm=TRUE) y2range <- range(y2,na.rm=TRUE) def.par <- par(no.readonly = TRUE) par(mfrow=c(2,2)) nf <- layout(matrix(c(2,0,1,3),2,2,byrow=TRUE), c(3,1), c(1,3), TRUE) par(mar=c(3,3,1,1)) plot(x, y1, xlim=xrange, ylim=y1range, xlab="...
2011 Apr 08
1
asking about contour plot with R
...re help) I hope you can help me (don't worry if you can't): Using "draw.contour" I get the contour but I want to place it in a cartesian-coordinate system where x = "Componente 1" range between -1 y 1 and y = "Componente 2" range between 0 and 3, regardless of xrange or yrange. Of course, xrange and yrange are important to obtain an adequate contour plot but I want to see that contour in the cartesian coordinate system I told you before. so I put ylim = c(0,3) and xlim = c(-1,1) but R ignores those sentences and gives me a graphic using xrange and yrange as l...
2007 Sep 27
1
windows device transparency issue
...0), levels=c("Placebo", "Not Placebo")) xdens <- tapply(x, trtp.f, density, na.rm=TRUE) ydens <- tapply(y, trtp.f, density, na.rm=TRUE) topx <- max(unlist(lapply(xdens, function(x) max(x$y)))) topy <- max(unlist(lapply(ydens, function(x) max(x$y)))) xrange <- range(x, na.rm=TRUE) yrange <- range(y, na.rm=TRUE) nf <- layout(matrix(c(2,0,1,3),2,2,byrow=TRUE), c(3,1), c(1,3), TRUE) par(mar=c(4,4,0,0), oma=c(0,0,0,0)) getcolors <- rainbow(length(levels(trtp.f)), alpha=.5) plot(x, y, xlim=xrange, ylim=yrange,xlab="X value&qu...
2012 Jan 19
1
Legend problem in line charts
...unique(Orange1$REFID) -> refid # Create Line Chart for (i in 1:length(refid)) { # convert factor to numeric for convenience refid1 <- subset(Orange1, REFID == refid[i]) refid1$ACTTRTnum <- as.numeric(refid1$ACTTRT) nACTTRTs <- max(refid1$ACTTRTnum) # get the range for the x and y axis xrange <- range(refid1$TIME1) yrange <- range(refid1$BASCHGA) # set up the plot pdf (paste("pga", i, ".pdf", sep='')) print(plot(xrange, yrange, type="n", xlab="TIME1 (WK)", ylab="BASCHGA (mm)" )) colors <- rainbow(nACTTRTs) linetype &...
2008 Apr 15
4
heavy graphs
Dear R community, I am creating large graphs with hundreds of thousands of datapoints. My usual way for output was pdf, but now I am getting file sizes of >30Mb that do not open well (or at all) in Adobe. Is there a way to reduce the resolution or get rid of overlaying datapoints? Any other idea is also warmly welcome! Thank you and wishing you a good day! Georg. **********************
2003 Aug 15
0
Re: [R} stars graphs
...clock plot that starts at the top and goes clockwise. There are probably other varieties that would be interesting. Jim -------------- next part -------------- # scales a vector of numbers to a new range rescale<-function(x,newrange) { if(is.numeric(x) && is.numeric(newrange)) { xrange<-range(x) if(xrange[1] == xrange[2]) stop("rescale: can't rescale a constant vector!") mfac<-(newrange[2]-newrange[1])/(xrange[2]-xrange[1]) invisible(newrange[1]+(x-xrange[1])*mfac) } else { cat("Usage: rescale(x,newrange)\n") cat("\twhere x is a nume...
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="",ylab="") contourplot(var1.pred~x+y, spcgrid, aspect = "xy&quo...
2003 Aug 13
1
stars graphs
Hi listers, A few days ago I posted a question about the use of the stars function on selected lines of a frame. Thanks to two helpers, a closer look at the scale argument allowed to partially solve the problem. Yet I still have a problem with stars. Allow me to explain what I intend to do (sorry for my poor English and the long post): I want to graph an activity index of a fish during the day
2006 Apr 19
1
scatterplot3d: fractionary xrange
Dear all, I'm plotting this and I need x range = (-2.5, 2.5). require(scatterplot3d) scatterplot3d(1,1,1, pch=19, xlim=c(-2.5, 2.5), zlim=c(0,2), ylim=c(0,3), xaxs="i", yaxs="i") In any case, it seems that in the drawing range for x is (-3,3). I guessed I could have this kind of behaviour for ranges: plot(1,1, pch=19, xlim=c(-2.5, 2.5), ylim=c(0,3),
2012 Jan 27
1
Help boxplot to add mean, standard error and/or stadard deviation
Dear researchers I wish to plot a box plot without the mean line (the black line) and plot only the mean (red square). Futhermore, is it possible to add standard error and/or stadard deviation? This is an example mytest <- c(2.1,2.6,2.7,3.2,4.1,4.3,5.2,5.1,4.8,1.8,1.4,2.5,2.7,3.1,2.6,2.8) boxplot(mytest,lty = "solid") means <- mean(mytest,na.rm=TRUE) points(means, pch = 22, col
2010 Sep 21
5
Combined plot: Scatter + density plot
...def.par <- par(no.readonly = TRUE) # save default, for resetting... x <- pmin(3, pmax(-3, rnorm(50))) y <- pmin(3, pmax(-3, rnorm(50))) xhist <- hist(x, breaks=seq(-3,3,0.5), plot=FALSE) yhist <- hist(y, breaks=seq(-3,3,0.5), plot=FALSE) top <- max(c(xhist$counts, yhist$counts)) xrange <- c(-3,3) yrange <- c(-3,3) nf <- layout(matrix(c(2,0,1,3),2,2,byrow=TRUE), c(3,1), c(1,3), TRUE) par(mar=c(3,3,1,1)) plot(x, y, xlim=xrange, ylim=yrange, xlab="", ylab="") par(mar=c(0,3,1,1)) barplot(xhist$counts, axes=FALSE, ylim=c(0, top), space=0) par(mar=c(3,0,1,1...
2012 Sep 27
3
Comparing density plots using same axes or same axes scale
Good Evening- I have a set of nine scenarios I want to plot to see how the distribution is changing, if one tail is getting larger in certain scenario, currently I am using this code colnames<-dimnames(sag_pdfs)[[2]] par(mfrow=c(3,3)) for(i in 1:9) { d<-density(sag[,i]) plot(d,type="n", main=colnames[i]) polygon(d,col="red",border="grey")} where sag is
2009 Mar 21
1
Forestplot () box size question
...[widthcolumn])), colgap) } colwidths <- unit.c(colwidths, graphwidth) pushViewport(viewport(layout = grid.layout(nr + 1, nc * 2 + 1, widths = colwidths, heights = unit(c(rep(1, nr), 0.5), "lines")))) cwidth <- (upper - lower) #xrange <- c(max(min(lower, na.rm = TRUE), clip[1]), min(max(upper, na.rm = TRUE), clip[2])) xrange <- c(xlow,xhigh) info <- 1/cwidth info <- info/max(info[!is.summary], na.rm = TRUE) info[is.summary] <- 1 for (j in 1:nc) { for (i in 1:nr) {...
2014 Dec 17
3
Problema con el subset
...lgo se lo agradezco. df  <- read.table(file="xxxx.csv", header=T, sep=";", dec=",") df  <-na.omit(df) dfgrupo<-subset(df,df$parametroslaboratorio=="Aflatoxinas ByG") niveles <- as.numeric(dfgrupo$param) ntrees <- max(niveles)  xrange <- range(as.Date(dfgrupo$fecha)) yrange <- range(dfgrupo$z) plot(xrange, yrange, type = "n", xlab = "Fecha del interlaboratorio",       ylab = "Z-score") colors <- rainbow(ntrees) ltipo <- c(1:ntrees) char <- seq(18, 18 + ntrees, 1)...