08-17-2009 02:20 PM
I'm having some issues trying to plot 3D data.
Ideally, I would like a surface plot, but I'm not sure I'm going about it correctly.
I have three 1D arrays of equal length: x, y, z.
The '3D surface graph' vi wants inputs of:
- x vector
- y vector
- z matrix
I dont have a z matrix, I have an array.
So instead, I am using '3D line graph'.
I only want to see the points like this:
But I am getting this:
The only way I got the top image is if I was dragging the plot around with my mouse.
Does anyone know how to remove the lines, so only the points are plotted?
Or better yet, how I could make a surface plot without a z-matrix?
Solved! Go to Solution.
08-17-2009 02:27 PM - edited 08-17-2009 02:29 PM
Can you attach a data set.
It looks like the data is a helix. Is the surface you're looking for a cylinder?
On an unrelated note, why are you a Yankees fan and going to Michigan State?
08-17-2009 02:30 PM
Can you attach a data set.
I attached some sample data. Thanks for looking at it.
On an unrelated note, why are you a Yankees fan and going to Michigan State?
I was born and raised in NY, I just came out to MSU for college.
Go Yankees!!!
08-17-2009 02:34 PM - edited 08-17-2009 02:39 PM
First, I recommend using the 3D Graph that is under the classic palette, not the one in Modern (as of 8.6)
To get dots instead of lines, just right click and hit cwgraph3d properties > Plots. then change the plot from line to dots.
08-17-2009 02:35 PM
It looks like the data is a helix. Is the surface you're looking for a cylinder?
No, the surface isnt going to be a cylinder.
The function is :
z = f(x,y)
x is roughly linear
y is roughtly 1/n
So it should look like a ..... ramp, for lack of better description
I'm going to have to figure out a fit to the data, but that will be an entirely different problem
08-17-2009 02:38 PM - edited 08-17-2009 02:42 PM
You could try wiring the 1d array, I think it will adapt.
Try downloading the codeI posted in this thread.
That example does multiple surfaces and mulitple lines to do this.
Ben
PS I count myself as part New-Yorker. My Father grew up there (New Rochelle) and my family lived there while my Father was being transfered between bases.
08-17-2009 02:50 PM
Ben wrote:
You could try wiring the 1d array, I think it will adapt.
Try downloading the codeI posted in this thread.
@Ben:
Which 1D array would I wire in?
Your VI would like an input of a 3D string array.
How can I make a 3D array out of 3 1-D arrays?
I dont think a Build Array would be correct.
08-17-2009 02:56 PM
The original posters data was in 3d so that what you see there.
Maybe this will be easier to start with.
It draws the car body shown above starting with a handfull of values in a control. You can change the values manually and watch what part of the image changes.
Ben
08-17-2009 02:57 PM - edited 08-17-2009 03:00 PM
Ya?
I'm not sure what the deal is with that bump...
Oh, and it's rotated. I just assumed the first column was x then y then z.
08-17-2009 03:08 PM
Perfect Tim, thanks a ton.
And thanks for the VI Ben, thats pretty cool.