Displaying 2 results from an estimated 2 matches for "userunits".
Did you mean:
userinit
2009 Jan 19
2
plotting arrows with different colors and varying head size
...0.05:0.1='grey';
0.1:0.15='cyan';
0.15:0.2='blue';
0.2:0.25='red'")
length=0.1
par.uin <- function()
# determine scale of inches/userunits in x and y
# from http://tolstoy.newcastle.edu.au/R/help/01c/2714.html
# Brian Ripley Tue 20 Nov 2001 - 20:13:52 EST
{
u <- par("usr")
p <- par("pin")
c(p[1]/(u[2] - u[1]), p[2]/(u[4] - u[3]))
}
## plot arrows
plot(as.vector(xcoor), as.vector(ycoor),...
2005 Jun 14
0
Plotting quiver vector tensor arrows 2d field data
...ow(u)
speed <- sqrt(u*u+v*v)
maxspeed <- max(speed)
u <- u*scale/maxspeed
v <- v*scale/maxspeed
matplot(xpos,ypos,type="p",cex=0)
arrows(xpos,ypos,xpos+u,ypos+v,length=length*min(par.uin()))
}
par.uin <- function()
# determine scale of inches/userunits in x and y
# from http://tolstoy.newcastle.edu.au/R/help/01c/2714.html
# Brian Ripley Tue 20 Nov 2001 - 20:13:52 EST
{
u <- par("usr")
p <- par("pin")
c(p[1]/(u[2] - u[1]), p[2]/(u[4] - u[3]))
}
u <- matrix(rnorm(100),nrow=10)
v <- matrix(rnorm(100),...