similar to: problem with outer and image

Displaying 20 results from an estimated 40000 matches similar to: "problem with outer and image"

2000 Apr 28
3
L(x,y,t)?
I have been using the following method to create L(x,t) x<-seq(1,66) time<-seq(1,19) v0<-.01 f0<-function(x,time) .45*cos(2*pi*3*x/66+v0*time) L0<-outer(x,time,f0) If I do image(L0) I get an x,t plot of a drifting cosine wave grating. The grating is actually a pattern of fuzzy bars; I have been ignoring the y dimension (because the grating is vertical: y has no effect on the
2011 Aug 16
2
issue with image plot in 2.13.1
R gurus, I'm having an issue with the appearance of image plots produced by R-2.13.1. When I plot an image (example code pasted below), thin white lines appear between rows and columns of pixels. The location of the lines seems somewhat random and change as the graphics device is re-sized. This occurs using a range of graphic devices (windows, png, bmp, jpeg, tiff, pdf), on two different
2001 Apr 06
2
bug in contour() ? (PR#897)
The following example just "hangs", i.e. the final contour() does not terminate. x <- pi*(0.5+((-13):12))/36 w <- 0.377*cos(2*x)*sqrt(abs(cos(2*x))) v <- c(rep(-1.47,13),rep(1.722,13))*abs(sin(x))^1.5 cr <- outer(w,w)+outer(v,v) s <- sqrt(diag(cr)) cr <- cr/outer(s,s) contour(cr[1:26,26:1],levels=seq(-1,1,0.1),axes=T) --please do not edit the information below--
2011 Sep 23
1
Cross Spectrum : Conversion of 2-D spectrum into a single complex array
Hi, I'm wondering why the spectrum() phase of quadrature couple isn't purely +/-pi. But mostly, I'm looking for a recommended way to take a 2-D spectrum and convert it into a single complex array. Kindly consider: # 10 Hz sine wave 10 seconds long sampled at 50 Hz deltaT = 1/50 t = seq(0, 10, deltaT) w = 2 * pi * 10 x = ts( sin( w * t ), deltat = deltaT ) y = ts( sin(
2003 Sep 29
2
parametric surfaces
Hi, does anyone know how to plot 3D parametric surface,e.g ellipsoid: x=a*cos(s)*cos(t), y=b*sin(s)*cos(t), z=sin(t); s in [0,2*pi], t in [-pi,pi]. Vytautas Maniusis, Vilnius University, Lithuania
2011 Sep 30
1
Odd gridding pattern when plotting
Hi, I'm no longer on the subscribing list, but was hoping to get my question posted.? Please inform if this is ok, although I am guessing you wont post with the image below.? If so, let me know and I will resend without the image. Thanks Hi, I just upgraded my system and my version of R all at once.? Upon running old code for heatmaps etc, I suddenly notice that there is an odd grid pattern
2007 Aug 11
1
Artifacts in pdf() of image() (w/o comments)
Dear r-helpers, In my previous message there were comments in the code that may have made cutting and pasting awkward. Here it is w/o them. I have two questions: (1) The following produces a pdf with artifacts. How do I prevent them? require(grDevices) imSize <- 200 lambda <- 10 theta <- 15 sigma <- 40 x <- 1:imSize x0 <- x / imSize -.5 freq = imSize/lambda xf = x0 * freq *
2010 Mar 23
1
filled.contour formatting questions
Hello, I'm having some trouble getting things to look as I want with filled.contour. 1. My first issue is that I am unable to add line segments to my plot where I want them. Using the rug pattern example: x <- y <- seq(-4*pi, 4*pi, len = 27); r <- sqrt(outer(x^2, y^2, "+")); filled.contour(cos(r^2)*exp(-r/(2*pi))); segments(0.2,0.2,1,0.2); The line segment is not found in
2009 Apr 03
2
Titles on lattice colorkey
Dear R-ers, I'm not sure if this is a missing feature, a support request, or stupidity on my part, but nevertheless, its a question. Is it possible to add titles to colorkey legends? As far as I can tell, there is a command to do it for normal "key" legends, but not for "colorkeys". eg it works for a normal key, created through auto.key xyplot(decrease ~ treatment,
2010 Jul 19
5
par("uin") ?
I inherited a function written either for an older version of R or SPlus to draw a brace, "{", in a graph. It uses par("uin") to determine the scaling of the quarter circles that make up segments of the brace, but that setting doesn't exist in current R. I'm guessing that, in the function below, ux, uy can be defined from par("usr") and
2007 Oct 31
3
thicker axis in levelplot
Dear R-help community, I need to find out how to make the black axis line around my plot thicker in levelplot, I cannot find the correct command in ?levelplot or ?par - or if it is there I cannot get it to work - any help would be more that appreciated! Here's an example script - I would want the code for making the axis bordering the plot thicker: x<- seq(pi/4, 5*pi,length=100)
2003 Dec 25
6
Plot a sphere
Hi, I'm new to R (and math ;) Would somebody please be so kind as to direct me in plotting a 3D sphere? I tried something in the lines of: #### y <- x <- seq(-pi, pi, length=pi*10) f <- function(x,y) { z <- sqrt(pi - x^2 - y^2) #z[is.na(z)] <- 0 z } z <- outer(x, y, f) persp(x, y, z, theta = 120, phi = 30) #### I've also tried: .... make.surface.grid(...) ..
2010 Aug 13
2
Unable to retrieve residual sum of squares from nls output
Colleagues, I am using "nls" successfully (2.11.1, OS X) but I am having difficulties retrieving part of the output - residual sum of squares. I have assigned the output to FIT: > > FIT > Nonlinear regression model > model: NEWY ~ PMESOR + PAMPLITUDE * cos(2 * pi * (NEWX - POFFSET)/PERIOD) > data: parent.frame() > PMESOR PAMPLITUDE POFFSET >
2011 Jul 27
2
fitting sine wave
Dear R-helpers ? I have 7 data points that I want to fit a continuous curve to, that should look similar to a sine wave My data points would mark the local minima and maxima respectively. This is what I?ve got so far. And I would keep doing so, but sadly nls() then says that it has reached the maximum number of Iterations? ?
2011 Jun 15
2
Trouble with compound functions---differential equations
Hi all, My apologies if this message is incredibly inept but I am very new to both computer programming and to R. I am working with the odesolve add-on and have the following function defined RVF_Single <- function(t, x, p) within the script I also have the following functions defined: T1<-function(t) {T1<-27.5-12.5*cos(2*pi*t/365)} and B1<-function(T1,t)
2007 Dec 18
1
Multiple plots with single box
Hello, I am trying to display some harmonic functions in a plot. The kind of display I have in mind is like the one that cn be obtained by a call to plot.ts with plot.type = "multiple". The only difference is that I want a single box containing all the plots instead of one box per plot. I thought box(which = "outer") would have done the job, but it didn't. Below is the
2017 Jun 14
4
[FORGED] Re: draw stripes in a circle in R
On 15/06/17 05:29, David Winsemius wrote: > >> On Jun 14, 2017, at 10:18 AM, David Winsemius <dwinsemius at comcast.net> wrote: >> >> >>> On Jun 14, 2017, at 9:46 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: >>> >>> I don't see a question. If your question is whether R supports pattern fills, AFAIK it does not. If that is
2012 May 29
1
lattice: add a marginal histogram on top of the colorkey of a levelplot?
Lattice experts: Can you think of a way to produce a levelplot as below and then add a histogram of the z variable to the top margin of the plot that would sit on top of the color key? x <- seq(pi/4, 5 * pi, length.out = 100) y <- seq(pi/4, 5 * pi, length.out = 100) r <- as.vector(sqrt(outer(x^2, y^2, "+"))) grid <- expand.grid(x=x, y=y) grid$z <- cos(r^2) *
2010 Feb 20
1
Add lines (contours) to lattice wireframe plot
Hi, I draw a surface corresponding to bivariate density of independent variables (rho=0) using persp(). Then I add a contour line (i.e., circle in my case) at a particular density. Below is a minimal example of what I have so far. # Bivariate density dnorm2d <- function(x, y, rho = 0) { xoy = (x^2 - 2 * rho * x * y + y^2)/(2 * (1 - rho^2)) density = exp(-xoy)/(2 * pi * sqrt(1 - rho^2))
2005 Mar 29
1
strange result of acos
Hi all, I have to calculate an expression using acos -function. A strange result of acos appears *1. case with error* ss <- sin(10.74*pi/180)**2 +(cos(10.74*pi/180)*cos(10.74*pi/180)*cos(0*pi/180)) ss acos(ss) [1] NaN Warning message: NaNs produced in: acos(ss) *2. case without error* ss <- sin(10.7*pi/180)**2 +(cos(10.7*pi/180)*cos(10.7*pi/180)*cos(0*pi/180)) ss acos(ss)