LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

plotting in 3D graph

I am trying to add more plots to a 3D graph. I am currently using the Plot3DCurve function and would like to step along the x axis and graph a new curve at the next x value. In effect, I want to end up with a surface but I am not using a surface function call because of the amount of data I want to display in the graph. When I try to do this, it deletes the previous curve plot before putting the next onto the graph. Does anyone know how to add to the 3D graph without deleting the plots that are already on the graph? Thanks
0 Kudos
Message 1 of 8
(4,501 Views)
You can always add a new plot by adding a new plot to the Plots collection. Use CW3DGraphLib_CWPlots3DAdd to add a new Plot. And then use the returned Plot handle with the Plot3DCurve method


I hope this helps
Bilal Durrani
NI
0 Kudos
Message 2 of 8
(4,482 Views)
I have changed to the PlotSurface function as of late. Do you mind giving me the proper way to use the add function in an example so that I can display the data in the graph? Thanks
0 Kudos
Message 3 of 8
(4,478 Views)
I am now able to add data to the graph without losing the previous plots. Does anyone know the command syntax for setting the max value for the x axis in a 3D graph? thanks
0 Kudos
Message 4 of 8
(4,470 Views)
Hello Kirk45,

According to the VB Help, you can set the range of the x-axis in the following way:

'Set the minimum and maximum values of the x-axis
CWGraph3D1.Axes.Item(1).Minimum = 0
CWGraph3D1.Axes.Item(1).Maximum = 100

So you would need to get a handle to the x-axis and then pass this handle to the CW3DGraphLib_CWAxis3DSetMaximum function. An example call would look like:

GetObjHandleFromActiveXCtrl (panelHandle, PANEL_CW3DGRAPH, &objectHandle);
CW3DGraphLib__DCWGraph3DGetAxes(objectHandle, NULL,&axesHandle);
CW3DGraphLib_CWAxes3DItem (axesHandle, NULL, CA_VariantInt(1), &xaxisHandle);
CW3DGraphLib_CWAxis3DSetMaximum (xaxisHandle, NULL,CA_VariantInt(100));


Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
Message 5 of 8
(4,463 Views)
I am now putting the data into the graph in chunks and changing the scale as needed. All of the help so far is greatly appreciated. Unfortunately, now I am running into the problem wherethe color scheme for the graph is applied to each chunk of data. Does anyone now how to update the scheme once all the data has been put into the graph so that it looks uniform across the graph? thanks
0 Kudos
Message 6 of 8
(4,450 Views)
I guess what I mean is how do I apply the color map to the final group of plots so that the coloring is uniform across the graph instead of each chunk having its own color map? thanks
0 Kudos
Message 7 of 8
(4,445 Views)
Hello Kirk,

The 3dGraph instrument does not provide a function that takes in multiple plots and assigns the color plot uniformly across each plot. Instead, you could use custom colors in your spectrum, where the last color used for plot 1, would be first color used in the color plot for plot 2 and so on. Granted, this technique might take some fine tuning to get the behavior you want. An example using custom color plots can be found in the 3DGraphColorMap shipping example.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
Message 8 of 8
(4,424 Views)