Displaying 20 results from an estimated 2000 matches similar to: "how to plot two surfaces with lattice::wireframe"
2009 Jul 16
1
Plotting Two Surfaces in one plot with wireframe() using groups=
Hi. I tried the following:
F<-function(x,y,b1,b2,b3) b1/(1+b2*(x+b3*y));
t<-data.frame(ExM=c(T$ExM,F(T$S1,T$S2,0.2,0.2,51.28205)),S1=rep(T$S1,2),S2=rep(T$S2,2),gr=c(rep(1,length(T$ExM)),rep(2,length(T$ExM))));
library(lattice);
wireframe(ExM ~ S1 * S2, data = t, groups=gr);
where T is da dataframe like T<-data.frame(S1=...,S2=...,ExM=...)
But the resulting response
2010 Nov 20
1
how to draw manifold?
Hi,
I need some help either in how to configure variables for wireframe(),
or some suggestions as to other graphics commands to use for plotting a
2-D manifold in 3-D space.
Here is an example I tried (in the hopes that it would plot a helical
line) :
xsp<-matrix(c(cos(seq(0,80)/5)),9,9)
ysp<-matrix(c(sin(seq(0,80)/5)),9,9)
zsp<-matrix(c((seq(0,80)/20)),9,9)
wireframe(zsp~xsp*ysp)
2010 Apr 20
1
3D surface plot with wireframe or persp?
Hello Dear,
I have a function, like z=f(x,y), and try a surface plot with this function.
But, on the reference of "wireframe" requires data option, so I generated x
and y, and computed z with them. But, still I have a problem to draw a
surface plot. The code and errors are
##################################################
mle_beta0=64.43707;
mle_beta1=-24365.16;
# generating for
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 individual
2006 May 08
1
persp or wireframe 3D plot: how can I independently adjust linewidth of the 'surface' and framebox?
It is a trivial matter to adjust the linewidth of the axes and plot
line in a 2D plot:
x <- 1:10;
y <- 1:10;
par(lwd=2); # axis (and others) linewidth
plot(x,y,"l",lwd=6); # plot linewidth
Is there anything comparable to this for persp or wireframe? I've
tried a number of ways, and the framebox/axes seem to be linked to
the linewidth used in generating the
2010 Apr 28
1
What is the best way to plots surfaces in 3 dimensions?
Hi R help,
What is the best way to plots surfaces in 3 dimensions?
I also have the following availability problem with "plot3d" and "scatterplot3d", and "wireframe":
install.packages("scatterplot3d")
Warning: unable to access index for repository http://cran.ch.r-project.org/bin/macosx/leopard/contrib/2.10
Warning message:
In getDependencies(pkgs,
2011 Oct 31
1
3D Graph Surface and single points (eg wireframe with points)
Hallo!
?
I just want to make a 3D plot of a surface of a cone and want to plot some single points around.
?
I tried wireframe but cannot find how to plot single points
?
I tried scatterplot3d but there the surface is not simple to plot. And: How can I rotate the point of view by the z-axis
?
I tried persp3d but how can I add some single points?
?
Example:
?
library(lattice)
library(scatterplot3d)
2011 Mar 04
1
lattice: wireframe "eats up" points; how to make points on wireframe visible?
Dear expeRts,
I would like to add two points to a wireframe plot. The points have (x,y,z) coordinates
where z is determined to be on the wireframe [same z-value]. Now something strange
happens. One point is perfectly plotted, the other isn't shown at all. It only
appears if I move it upwards in z-direction by adding a positive number. So somehow
it disappears in the wireframe-surface
2009 Nov 27
1
plotting two surfaces simultaneously in a single panel
Hi,
I have recently begun using the lattice package, and have been using
the wireframe command to visualise matrices which are model outputs. I
have been trying to plot two surfaces (from two matrices)
simultaneously in one panel, to visualise intersections etc., but
neither my attempts or trawling the net are helping me find how to do
this.
Can someone help? Thanks
Cheers,
Umesh Srinivasan
2009 Jun 24
1
lattice wireframe within a loop ???
Hi,
I have the following problem. Calling wireframe within a loop results
into an empty window(s)
#generate some data
temp = expand.grid(A = 1:3,B = 1:3)
temp = cbind(temp, y1 = rnorm(9))
temp = cbind(temp, y2 = runif(9))
#plot y1 and y2 in two different windows
for(i in 1:2)
{
wireframe(y1 ~ A*B, temp, shade =T)
windows()
wireframe(y2 ~ A*B, temp, shade =T)
}
#However, calling it twice
2006 Oct 25
1
cloud() works but wireframe() is blank
Per the message from Alexander Nervedi, 29 April 2006:
> I have to be making a riddiculously silly ommission.
> when I run the fillowing i get the cloud plot ok. But I cant figure
> out what I am missing out when I call wireframe.
> Any help would be appreciated.
> x<-runif(100)
> y<-rnorm(100)
> z<-runif(100)
> temp <-data.frame(x,y,z)
>
2007 Sep 26
1
add points to wireframe
Hello
R-classicist won't like the following question due to there's no minimal reproducible example and the question was posted already.
Anyway I'm not able understand this rather complicated version of "add points to wireframe".
what I have is matrix 3x2000 with a dem<-(x,y,z, coordinates) (not provided).
with follwing code I want to produce the wireframe and add some
2013 Mar 05
1
different colors for two wireframe spheres
Dear List,
I have the code below adapted from the lattice-package examples to draw two spheres. I would now like to give
both different surface colors, e.g. one red and one blue.
## 3-D surface parametrized on a 2-D grid
n <- 10
tx <- matrix(seq(-pi, pi, length.out = 2*n), 2*n, n)
ty <- matrix(seq(-pi, pi, length.out = n) / 2, 2*n, n, byrow = T)
xx <-
2012 Nov 22
1
[lattice] Increase distance between tick labels and ticks in wireframe plot ("pad")
Hello,
I try to increase the distance between tick labels and ticks in a lattice wireframe plot. Here's a minimal example:
## Minimal example
x <- y <- z <- c(1,2,3)
df <- data.frame(x, y, z)
wireframe(z ~ x*y, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6))
I tried the axis.components option
2011 Feb 23
1
lattice.wireframe missing wireframe
Hello Everyone,
I am using R ver. 2.10.1 (2009-12-14). I installed lattice today via install.packages.
I am doing this minimal example:
M = read.csv("/path/to/csv")
cloud(x ~ y * z, data = M)
this correctly gives me a scatterplot of the csv data which has 3 columns. Every column contains 1800 numeric 0 < values < 1300
when I want to plot the corresponding wireframe via
2006 Jun 27
3
how to rotate a triangle image(ZMAT) ?
Hello R users...
how to align this Zmat (triangle image) in X axis?
I would like that the triangle's base become in the X
axis and
the triangle's height become in the Y axis
Is there some trick for make this?
Thanks.
Cleber
######################## my test and try
f <- function(x,y){
z=1-x-y
z[ z < (-1e-15) ] <- NA
return( -100*x+0*y+100*z )
}
x = seq( 1, 0,
2004 May 07
1
plotting planes and lines in wireframe()
Hi R-helpers
I would like to plot some planes which are perpendicular to the x-y
plane, such as x=y. Is there a way to do this in wireframe? I realize
that I am not plotting a function of x, y since there are infinite
number of z's that satisfy the above relation.... Hmm...
Somewhat related, I would also like to plot a line in 3 d space...
Finally, if you are feeling really brave, I
2011 Apr 01
1
Lattice wireframe or cloud plot with different colours by a group
I have a question about wireframe 3-D plots and how to apply colors. I have
a large dataset of river flow (m^3/s) over time, and I have coded these
flows based on their height. I would like to produce a wireframe plot that
colors the graph based on the flow code, i.e. I would like high flows to be
red, medium to be green and low flows to be blue. Here is some sample data
with the basic
2011 Jul 12
1
spatial logit help
Please I am new to R. I got the following code from a friend:
gmat <- cbind(gmat,p*(1-p)*wxb)
for (j in seq(1:ncol(gmat))) {
gmat[,j] <- fitted(lm(gmat[,j]~zmat))
}
It is for spatial logit.
After defining all the matrices in it such as P, wxb, gmat, and zmat,
I tried to run it in R and got the following error message:
Error in model.frame.default(formula = gmat[, j] ~ zmat,
2009 Aug 18
1
adding points to a wireframe
A quick question. I'm trying to plot a surface from a fitted model
along with the original points, as in the following example:
df<-data.frame(expand.grid(100*runif(1:100), 100*runif(1:100)))
df$Var3<-rnorm(length(df$Var1), mean=df$Var1*df$Var2, sd=10)
my.lm<-lm(Var3 ~ Var1*Var2, data=df)
my.fun<-function(x,y) predict(my.lm, data.frame(Var1=x, Var2=y),