2D plot of surface slice

  • Permalink
  • submit to reddit
  • Email
  • Follow


I have a surface created with TriScatteredInterp, exactly as in the example here:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/triscatteredinterpclass.html

Now i need a 2D line plot of the intersection of a vertical plane with this surface.  This should be a very common problem, just the depth/elevation profile of a surface along a line, but I cannot find an example.  
0
Reply Noel 11/19/2009 7:20:22 PM

See related articles to this posting


"Noel Black" <tex.noel@gmail.com> wrote in message 
news:he45pm$1qv$1@fred.mathworks.com...
>I have a surface created with TriScatteredInterp, exactly as in the example 
>here:
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/triscatteredinterpclass.html
>
> Now i need a 2D line plot of the intersection of a vertical plane with 
> this surface.  This should be a very common problem, just the 
> depth/elevation profile of a surface along a line, but I cannot find an 
> example.


Hi Noel,

When viewed from the Z direction your slice plane is line in the X-Y plane.
You just need to create a poly-line in the X-Y plane, compute the 
corresponding values on the surface and plot them.
Here's an example that refers to the same data set;
Let's take a line that goes from (-2,-2) to (2,2) in the X-Y plane
The poly-line is as follows;
xl = (-2:0.25:2)';
yl = (-2:0.25:2)';

% Now evaluate the elevation on the surface
zl = F(xl,yl);

% Next plot the line on the surface
% Due it sampling inaccuracies the line will weave above and below the 
surface facets.
% I will lift it up a tad to make the plot look pretty

mesh(qx,qy,qz);
zl_lifted = zl + max(zl)*0.05;
hold on;
plot3(xl,yl,zl_lifted, '-k', 'LineWidth',1.4)
hold off

How's that?

Damian




0
Reply Damian 11/20/2009 4:22:01 PM

"Noel Black" <tex.noel@gmail.com> wrote in message <he45pm$1qv$1@fred.mathworks.com>...
> I have a surface created with TriScatteredInterp, exactly as in the example here:
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/triscatteredinterpclass.html
> 
> Now i need a 2D line plot of the intersection of a vertical plane with this surface.  This should be a very common problem, just the depth/elevation profile of a surface along a line, but I cannot find an example.  


give a look at this:

http://www.mathworks.com/matlabcentral/fileexchange/10408-contours-for-triangular-grids

http://www.advancedmcode.org/
0
Reply Luigi 12/8/2009 12:24:02 PM
comp.soft-sys.matlab 203691 articles. 536 followers. Post

2 Replies
869 Views

Similar Articles

[PageSpeed] 30


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

How to plot a slice of surface plot data
Hello, Im stuck, i am trying to plot a surface with same x values for analysis. The data has been obtained from a laser scanner and has been plotted using surf. Im finding it difficult to plot X,Y,Z Values for particular X values (Say surf(x,y,z) where i want to plot values x =4:10) Does anyone know if this is possible? Tom Tom Bailey <hussain.zj@gmail.com> wrote in message <25410744.1213367240478.JavaMail.jakarta@nitrogen.mathforum.org>... > Hello, > > Im stuck, i am trying to plot a surface with same x values for analysis. The data has been obtained from a laser...

2D surface plot
I want to create a colored 2D surface plot based on three vectors, x- and y-coordinates and values for each point. Scatter sort of works, but I want a filled surface, not just circles. Hope anyone can help. "Andreas Bradley" > I want to create a colored 2D surface plot based on three vectors, x- and y-coordinates and values for each point. > Scatter sort of works, but I want a filled surface, not just circles... a hint: help griddata; us "Andreas Bradley" <andbr659@student.liu.se> wrote in message <gmbot6$a9c$1@fred.mathworks.com>... > I want ...

Plotting spherical slice surfaces
I want to plot a region between 2 spheres constrained by constant longitudes and constant latitudes. That is, if we want to plot a box in Euclidean space, we would plot 6 planes with x_min, x_max and so on constant. What I want to plot is region between given r_min and r_max, longitude_min (etamin) and longitude_max(etamax), latitude_min (lambdamin) and latitude_max (lambdamax). A constant longitude only surface would be just a plane perpendicular to xy-plane and its projection in xy-plane would be just a line. Here is what I have done for this one surface particular: n = 100 rmin ...

help with 2d slice through a 3d surface
Okay, I'm stumped. How do I get a 2D slice of a 3D surface? Say I graph the simple polynomial function: Z=.5*X +.5*Y +-1.5*X.^2 + 3.0*X.*Y + -1.5*Y.^2; So, xmin = -5; xmax = 5; ymin = -5; ymax = 5; gridresolution = 25; x = linspace(xmin, xmax, gridresolution); y = linspace(ymin, ymax, gridresolution); [X,Y] = meshgrid(x,y); Z=.5*X +.5*Y +-1.5*X.^2 + 3.0*X.*Y + -1.5*Y.^2; surf(X,Y,Z) Now, how can I look at the 2D graph of X-Z at Y=0? I've played with slice all day and searched the archives extensively but I don't have a volume here with equaly spaced observations. Z...

Slicing a surface plot in object graphics
Hi all, Does anyone have code that demonstrates how to have a movable xz and/or yz plane on an object graphics surface plot? The idea is to plot slices of the surface on the top/right of the surface and allow the user to interactively choose the locations. Unfortunately, starting with modified versions of fsc_surface and plot_surface, I haven't made it too far. Does anyone have a quick example they can post? Many thanks, Jamie Jamie Smyth writes: > Does anyone have code that demonstrates how to have a movable xz > and/or yz plane on an object graphics surface plot? The idea i...

2d surface plot in comsol with matlab
I have a 2d surface plot calculated in comsol. I am using the postplot command and I would like the to change the z-axis to logarithmic scale. By doing so the image dissapears both if I try to change it in the GUI or if I change "axistype" in the code from 'lin' to 'log'. Below is the code I am using: postplot(fem, ... 'tridata',{'absux_poeq^2','cont','internal'}, ... 'trimap','winter(1024)', ... 'flowdata',{'ux','uy'}, ... ...

RGB 2D slice in a 3D plot
Hello, I made a program in which I segmented a certain RGB object from a picture. In the image, only the RGB pixels are shown and the surrounding pixels I gave a zero-value. Now I want to plot only the RGB slice in a 3D plot, without the surrounding pixels. So that the surrounding is transparant. Does anyone have suggestions how I can achieve this? In another program I did this by changing the alpha channel. When this is done, I want to plot multiple object by this method in the same 3D plot. Is this possible? A lot of thanks in advance "Els " <y.e.t.reeuwijk@student.utwente...

plotting 2D surface from nonuniform data
I'm having a problem plotting a 2D surface where the data is not uniform. To simplify the problem I will use an example of data scattered around the outside of a cylinder. The data can be generated by N=1e2; % number of points a=.03; % radius a [x y]=pol2cart(rand(N,1)*2*pi,.03); % hollow cylinder z=rand(N,1)*2*pi; Since this is 2D, anything that uses Qhull doesn't work like delaunay and griddata. Any suggestions? ...

3D-surface of many 2D-Slices (stereography)???
Hi! I have read so many tutorials and downloaded so many files - nothing worked. I have a Matrix M(x,y,z). In this Matrix I have an object (e.g. a cylinder). The coordinates where the cylinder lies in the Matrix are 1, all other entries of the Matrix are 0. So I have a set of Points P with the coordinates x, y and z. Now I want to plot the object in 3D, like all the slices of the Matrix M are stacked. How can I do this? Pleas Help!!! "Steve " <stefan.griesser@alumni.unileoben.ac.at> wrote in message news:hmvu7h$k3e$1@fred.mathworks.com... > Hi! > ...

Extracting data from a 2D surface plot in Matlab
Hi, I have a 2D surface plot in Matlab depicting concentration values at any point on the surface. Was wondering how I could extract the data for it into a matrix of some sort. It would be useful to know how to do this for any surface plot in general 2D or 3D. Thanks in advance. Harsh Dhingra wrote: > I have a 2D surface plot in Matlab depicting concentration values at any > point on the surface. Was wondering how I could extract the data for it > into a matrix of some sort. It would be useful to know how to do this > for any surface plot in general 2D or 3D. Th...

fitting a mesh to a 2D scatter plot surface
hi, would like some help with the following problem. I have a 2 dimensional scatter plot surface which can best described as a sheet folded over onto itself with two bends (ie there is a set of the domain (x,y) with three simultaneous solutions, while at other (x,y) on the domain there is only one solution). Now, because I cannot fit a parametric solution to the scatter plot I tried delaunay triangulation; but because of the overlap the result wasn't pretty. I'm wondering if there is an elegant solution to basicallly 'fill in' the scatter plot. At the moment i am reduce...

plot slices of 3D data as 2D image
How to plot 3d array as 2d image and also how to visualize 3d data. On Feb 2, 4:27=A0am, "Priya " <priya.biom...@gmail.com> wrote: > How to plot 3d array as 2d image and also how to visualize 3d data. -------------------------------------------------------------------------- How do you WANT to display it? Do you just want to extract a slice and display that using imshow()? Do you want to do an average over all slices? Or a maximum intensity projection? Or something else? Have you looked at the 3D visualization stuff in the help contents? For true volumetric rendering...

Plotting two 2D images in a surface figure
I would like to put two 2D images (two 575*575 matrices) up next to each other so that it looks like they together form two sides of a cube. I was hoping to do a surface plot with one of them in the x,z plane and the other in the y,z plane but got kinda stuck trying to get the arguments right. This is where I seemed to get stuck: surf(zeros(575,575),1:575,b,imS) imS is the image matrix. This makes a black surface with x=0, y going from 1 to 575 and the value in z is the maximum value of the y'th row in imS. The image matrices (575*575) should give the color of the point so that for inst...

how to plot a 2D-function on the surface of a 3D-function
Hi, I'd like to plot the function g(x):=3x+5 on the surface of the function f(x,y):=x^2+y^2. Therefore I came up with the following maple code: #Definition of f(x,y):=x^2+y^2 f := proc (x, y) options operator, arrow; x^2+y^2 end proc #Definition of g(x,y):=3x+5 g := proc (x, y) options operator, arrow; piecewise(x = 3*x+5, x^2+y^2, x <> 3*x+5, undefined) end proc #Graph plot3d([g, f], -5 .. 5, -5 .. 5) But unfortunately the function g(x) is not seen, it is covered by the function f(x,y) (because if I fade f(x,y) out, I can see g(x) ). So, how can I display ...

Creating 3D Surface Plots From a Series of 2D Graphs
Hi, I'd like to create a smoothed 3D surface plot from a series of 2d graphs. Here is a link to a 2d graph that shows a number of line graphs. http://i.imgur.com/a2AUGFb.png Each line graph has a unique and constant z coordinate. I want to use these to create a nifty looking 3d surface graph. There will be more line graphs than are shown here to complete the surface. I have scidavis, octave, and gnuplot, and have used them a little bit, scidavis the most because it's so quick and easy for 2d stuff. Any ideas as to how I could accomplish this 3D plot? Best regards...

2D surface plot using non-uniform data file
Hi, I have a three-column data file such as 7.7920E+07 -3.4235E+08 1.3806E-03 7.6031E+07 -3.4249E+08 1.3606E-03 7.3991E+07 -3.4630E+08 1.1280E-03 7.8711E+07 -3.4892E+08 9.4483E-04 8.9620E+07 -3.4921E+08 7.2573E-04 6.7268E+07 -3.3500E+08 1.8679E-03 8.4936E+07 -3.4384E+08 1.1604E-03 8.1936E+07 -3.5992E+08 5.5310E-04 8.1639E+07 -3.6252E+08 6.0408E-04 7.2605E+07 -3.3525E+08 1.9559E-03 First and second columns are x and y coordinates respectively. And, the third column represents data value on the coordinat...

Surface (2D) plot using decimal non-uniform data points
Hi, I have a three-column data file such as 7.7920E+07 -3.4235E+08 1.3806E-03 7.6031E+07 -3.4249E+08 1.3606E-03 7.3991E+07 -3.4630E+08 1.1280E-03 7.8711E+07 -3.4892E+08 9.4483E-04 8.9620E+07 -3.4921E+08 7.2573E-04 6.7268E+07 -3.3500E+08 1.8679E-03 8.4936E+07 -3.4384E+08 1.1604E-03 8.1936E+07 -3.5992E+08 5.5310E-04 8.1639E+07 -3.6252E+08 6.0408E-04 7.2605E+07 -3.3525E+08 1.9559E-03 First and second columns are x and y coordinates respectively. And, the third column represents data value ...

How to plot surface plots
I would like to know how to make surface plot using X, Y and Z. I have values for all the three variables. A Surface plot for force is required (Z) Speed Feed Force 1050 0,05 88 1050 0,1 103,2 1050 0,15 129,4 2020 0,05 89 2020 0,1 111,2 2020 0,15 124,25 2750 0,05 73,2 2750 0,1 100,25 2750 0,15 137,33 "Vijayan " <vkrishnaraj@hotmail.com> wrote in message <gvgq6a$o4s$1@fred.mathworks.com>... > I would like to know how to make surface plot using X, Y and Z. > > I have values for all the three variables. A Surface plot for force is required (Z) > > Speed ...

Plot contour plots on 2D planes of 3D plot
Hi, I am trying to plot 3 contour plots (2D) on the three planes that defines a 3D plot, I mean, one contour plot in the ZX plane, another in the ZY, and the last one in the XY plane. Any idea how to do it? Cheers, Jorge. "Jorge " <j.fernandez@uam.es> wrote in message <frtvud$el7$1@fred.mathworks.com>... > Hi, > > I am trying to plot 3 contour plots (2D) on the three planes > that defines a 3D plot, I mean, one contour plot in the ZX > plane, another in the ZY, and the last one in the XY plane. > Any idea how to do it? > &...

problem with plotting surface plot
Dear all i am plotting a workspace of a manipulator. i have the 3D plot, but i want to have a surface plot in 3D. If any one can help me in this regard, it will highly appreciated, the data i have is scattered........ the [x, y, z] coordinate of the point is given "aftab Ahmad" <aftaba@kth.se> wrote in message <i5gg7c$9iv$1@fred.mathworks.com>... > Dear all i am plotting a workspace of a manipulator. i have the 3D plot, but i want to have a surface plot in 3D. If any one can help me in this regard, it will highly appreciated, the data i have is scattered........ &...

3D plot from 2D plot
Hi; I've got many wavelet spectra and I need to put them in the same plot in order to compare them. I could just superimpose them in a 2D plot, but that would be chaotic so I'd like to create a 3D plot by putting every spectrum next to another. For example I could have Power Spectral Density on the Y axis, Frequencies on the X axis and plot a different spectrum every, say, 0.5 Z. I don't know if I make myself clear... Any idea? Thanx Lorenzo Lorenzo wrote: > Hi; > I've got many wavelet spectra and I need to put them in the same plot in order > to compare them. I could...

plotting 2D image in a 3D plot
I'm going mad because I am sure it is easy to do what I want to do, but I can't find any clues in the docs how to do it. I have a set of geographic data - lat long and height. But the area is restricted enough that I can plot as x y and z without any projection. I want to plot them in a 3-D plot, with a 2-D image plotted on the XY plane. The 2D image is a geotiff file, so can be used with all the mapping functions. Any suggestions would be welcomed. If you're trying to use image or imagesc, and then calling 3D plot functions afterward, that won't work. Use surf or pcolor ...

Placement of 2d plots in 3d plots
Hi Can anyone tell me how to precicely place 2d plots in a 3d plot. More specifically I need to place a 2d contour and quiver plot below a surface plot. I have set the axes on the z-range to go from -1 to 5 and the surface data goes from 0 to 5. I would then like to place the contour and quiver plot at the bottom (z = -1), but matlab (7.0) places it at z = 0. I think I've seen it somewhere in the help sometime, but I couldn't find it again... :-( thanks ...

plotting multiple 2d plots on the same graph
Hi! I've created the following 3D plot using the following code. http://s643.photobucket.com/albums/uu154/Nasalcherry/?action=view&current=example3Dplot.jpg load pointtwo_ODdatadt.txt; z = pointtwo_ODdatadt(:,1); x = pointtwo_ODdatadt(:,2); y = pointtwo_ODdatadt(:,3); load pointtwo_ODdatadx.txt; z1 = pointtwo_ODdatadx(:,1); x1 = pointtwo_ODdatadx(:,2); y1 = pointtwo_ODdatadx(:,3); load pointtwo_ODdatagl.txt; z2 = pointtwo_ODdatagl(:,1); x2 = pointtwo_ODdatagl(:,2); y2 = pointtwo_ODdatagl(:,3); load pointtwo_ODdatagv.txt; z3 = pointtwo_ODdatagv(:,1); x3 = pointtwo_ODdatagv(:,2); y3 = ...