search for: ylim

Displaying 20 results from an estimated 2626 matches for "ylim".

2012 Oct 09
1
ylim with only one value specified
Dear R developers, I would like to have R choose the limits of the y-axis semi-automatically, e.g., zero should be included, but the maximum should be chosen depending on the data. Examples: plot(1:10, 1:10) # selects min and max automatically plot(1:10, 1:10, ylim=c(1, 10)) # manual definition plot(1:10, 1:10, ylim=c(0, Inf)) # this would be a nice feature, i.e. lower y limit = 0 defined manually, upper limit = 10 selected automatically The relevant code from plot.default would have to be modified: old: ylim <- if (is.null(ylim)) range(xy$y[is...
2008 Jul 24
1
plot.dendrogram xlim/ylim
list(...), I would like to zoom in to the leaves of large trees in a dendrogram plot. The playwith package allows zooming by passing xlim and ylim arguments to the plot call (Hmisc does this too I think). But currently stats:::plot.dendrogram does not accept xlim or ylim. So I would like to enable that. In place of the existing code chunk: xlim <- c(x1 - 1/2, x2 + 1/2) ylim <- c(0, yTop) if (horiz) { xl <- xlim...
2003 Sep 16
7
Retrieve ... argument values
Dear R users, I want to retrieve "..." argument values within a function. Here is a small exmaple: myfunc <- function(x, ...) { if (hasArg(ylim)) a <- ylim plot(x, ...) } x <- rnorm(100) myfunc(x, ylim=c(-0.5, 0.5)) Error in myfunc(x, ylim = c(-0.5, 0.5)) : Object "ylim" not found > I need to retrieve values of "ylim" (if it is defined when function is called) for later use in the function. Can anybody...
2008 May 22
1
plot 7 * 3 matrix on DIN A4 pdf
...rm(mean(100,mean=50,sd=10)),rnorm(mean(100,mean=50,sd=10))) par(mfcol=c(7,3)) par(pch=19) par(pty="m") #"s" makes a square plot par(cex=.1) par(cex.axis=7) par(omi=c(1,1,1,1)) axistick<-c(0,10,20,30,40,50,60,70,80,90,100) par(mar=c(3, 5, 0, 0) + 0.1) plot(x,xlim=c(0,50),ylim=c(0,100),axes = FALSE) axis(2,ylab='',at=axistick) box(lty=1) plot(x,xlim=c(0,50), ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) plot(x, xlim=c(0,50),ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) plot(x,xlim=c(0,50), ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) plot(x,xlim=c(0,50), ylim...
2010 Feb 14
2
lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?
Hello, When drawing "barcharts", I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non-intuitive. I have tried to study > library(lattice) > panel.barchart but am unable to figure out where ylim is taken care of and how one might fix ylim[1] to 0 for barcharts ... Can anyone point out how to...
2000 Aug 21
4
symbols: xlim and ylim cannot be specified (PR#639)
symbols(iris[,1],iris[,2],rectangles=as.matrix(iris[,3:4]),inches=0.3, ylim=c(1,5)) Error in plot.default(NA, NA, type = "n", ylim = ylim, xlim = xlim, xlab = xlab, : formal argument "ylim" matched by multiple actual arguments Since plot is called inside symbols, with specified xlim and ylim, any specification through ,... hurts this call. I am p...
2009 Apr 02
1
In plot.zoo the screens and ylim arguments seem incompatible
I am plotting multiple graphs per window with multiple series on each graph. When I try to set ylim I get the error below: Error in ylim[[idx]] : subscript out of bounds Am I incorrectly specifying my ylim list or is this a bug? Here is a simple reproduction: z <- zoo(cbind(a = 1:10, b = 11:20, c = 21:30)) # This works plot(z, ylim = list(a = c(1,40))) # This works plot(z, screens=c(1,2,2))...
2001 Nov 14
3
rpart:plotcp doesn't allow ylim argument (PR#1171)
Full_Name: Gregory R. Warnes Version: R 1.3.1 OS: Solaris 2.8 Submission from: (NULL) (192.77.198.200) rpart library version 3.1-2 Error message: > plotcp(fit.thirds.1,ylim=c(0.7,1.5)); Error in plot.default(ns, xerror, axes = FALSE, xlab = "cp", ylab = "X-val Relative Error", : formal argument "ylim" matched by multiple actual arguments > This can be corrected by adding ylim to the list of formal argument and wrapping the defin...
2006 Mar 24
3
bug in plot.acf (PR#8705)
...re's a bug in plot.acf, when plotting acf for multivariate time series. > Here a reproducible example: > > X <- rnorm(1000) > Y <- -X + rnorm(1000, sd=0.6) > Z <- cbind(X,Y) > > In > acf(Z) > cross-correlation plot y-axis is limited to 0-1. But: > acf(Z, ylim=c(-1,1)) > shows that there was a negative correlation, that was cut away in the > previous plot. > > I've seen the error is trivial. There's something like: > > for(each pair of univariate time series) { > if(is.null(ylim)) { > ...#set ylim properly > } > .....
2006 Jul 15
1
termplot and ylim
Hi together, I always get an error message with using ylim in termplot(), like this: > x<-(1:10) > y<-(10:1) > l<-lm(y~x) > termplot(l,ylim=c(1,2)) Is this a bug, or is there another possibility to do that? Especially, I would like to use term.plot() for gamlss objects. Thanks for your help! Andreas -- Echte DSL-Fl...
2003 Sep 17
2
Just don't do it, surely? (was RE: Retrieve ... argument values)
There have been various elegant solutions to test for the presence of a particular named parameter within a ... argument, such as if (!is.null(list(...)$ylim)) if ("ylim" %in% names(list(...))) I think I'd have to comment these lines pretty clearly if I wanted to easily follow the code in 6 months time. But I'm still not convinced it is ever a good idea to use this technique in preference to using explicit named arguments. If there...
2010 Jun 15
2
Unspecified [upper] xlim/ylim?
...reas I know that it cannot be less than (say) 0; and I want to fix the lower limit at 0 in any plot, leaving the upper limit to be assigned by plot() as a result of the computed values. I know I can do this by determining the max() of the data, and then computing a "Ymax" to put in (say) ylim = c(0,Ymax). However, for certain reasons, I would prefer not to have to do this. (And it's just a preference ... ). Whereas one can leave the whole issue of setting both plotting limits to plot(), by not specifying ylim (or xlim), or one can explcitily specify both the upper and lower limits...
1999 Jan 25
2
graphical paramters to boxplot
Dear all, is this a bug or do a miss something (this concerns version 0.63.1 on Linux)? > boxplot (c (1, 2, 3, 4, 5), ylim= c (-5, 5)) Warning: parameter "ylim" couldn't be set in high-level plot() function > boxplot (c (1, 2, 3, 4, 5), pars= list (ylim= c (-5, 5))) Warning: parameter "ylim" couldn't be set in high-level plot() function > and actually in both cases ylim is set as I wa...
2011 Oct 24
1
Adding points to a wireframe: 'x and units must have length >0' error
...-> gridd$z data.frame(x = runif(10, -4, 0), y = runif(10, 0, 40))-> pts1 pts1$z <- pts1$x*pts1$y # plot wireframe(z ~ y*x, gridd, drape = TRUE, colorkey= TRUE, scales = list(arrows = FALSE), pts = pts1, panel.3d.wireframe = function(x, y, z,xlim, ylim, zlim, xlim.scaled, ylim.scaled, zlim.scaled, pts1, ...) { panel.3dwire(x = x, y = y, z = z, xlim = c(-4, 0), ylim = c(0, 40), zlim = c(-160, 0), xlim.scale...
2009 Apr 22
1
reversing xlim, ylim in smoothScatter
Hello, I have found that in smoothScatter it is not possible to reverse the axes plotted (R version 2.9.0) .   It appears that this arises from the hard coding of xlim and ylim in smoothscatter.R in the lines : x <- x[ xlim[1] <= x[,1] & x[,1] <=xlim[2], ]   (line  number 25) and x <- x[ ylim[1] <= x[,2] & x[,2] <= ylim[2], ]  (line number 31) This results in a x being NA if ylim[1] > ylim[2] which results in an error on executing  map &l...
2002 Mar 19
3
plot with the axes at xlim and ylim
I'd like to make a plot with the axes drawn at the values of xlim and ylim. The default plot draws the axes slightly outside these values. I have been experimenting with the par(mgp) setting, but specifying par(mgp=c(2,0,-1)) gives me "invalid value specified for graphics parameter "mgp".". A more complicated mathod that almost seems to work is doin...
2006 Jan 05
4
ylim problem in barplot
R Version 2.2.0 Platform: Windows When I use barplot but select a ylim value greater than zero, the graph is distorted. The bars extend below the bottom of the graph. For instance the command produces a problematic graph. barplot(c(200,300,250,350),ylim=c(150,400)) Any help would be appreciated. Paul [[alternative HTML version deleted]]
2008 Apr 30
2
wireframe - add data points
...- punten[,2:2] z <- punten[,3:3] pts <- data.frame(x=x,y=y,z=z) ##end import original data## wireframe(status~totalfrost*logtps,abc,scales=list(arrows=TRUE),drape=TRUE, screen =list (x=15, y=-50, z=-105), pts = pts, panel.3d.wireframe = function(x, y, z, xlim, ylim, zlim, xlim.scaled, ylim.scaled, zlim.scaled, pts, ...) { panel.3dwire(x = x, y = y, z = z, xlim = xlim, ylim = ylim, zlim = zlim,...
2007 Jun 26
4
boxplot and bxp do not respect xlim by default (PR#9754)
...nux Submission from: (NULL) (194.73.101.157) bxp() allows specifcation of box locations with at=, but neither adjusts xlim= to fit at nor does it respect xlim provided explicitly. This is because bxp() now includes explicit xlim as c(0.5, n+0.5), without checking for explicitly supplied xlim (or ylim if horizontal). This also prevents simple added plots (eg if add=T, with at=(1:n)+0.5, the last box is partly off the plot. The 'offending' code is in bxp: if (!add) { plot.new() if (horizontal) plot.window(ylim = c(0.5, n + 0.5), xlim = ylim,...
2009 Jul 21
4
How to extract the upper xlim and ylim of my plot?
Dear R-helpers, I wish to place some text in a plot, at approx 10% of my upper xlim and approx 90% of my upper ylim, i.e. > plot(log(all$SR,10)~log(all$AREA,10)) > text(.1*max(xlim),.9*max(ylim),"text to be placed") (I know how to give absolute coordinates for text location, but I wish to use relative coordinates). My code (above) doesn't work because I don't know how to properly extra...