LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

MathScript Nugget #9: The 3D Graph

I mentioned in a previous nugget that I'm a fan of the 3D data display in the MathScript Probe. In today's nugget I'll talk more about some of the features that make this display so great.

The 3D graph appears in a few different parts of MathScript. You can see it in the MathScript Probe or MathScript Window if you have a variable that's a 2D array. Select the variable in the Variables tree and then select the 'Surface' item of the drop down menu. You'll see an interactive 3D surface showing your data. You can rotate the surface by dragging with the mouse, and zoom and shift it by dragging while holding the Shift or Control keys.

You can also see the 3D graph by calling a 3D plot function like 'surface' (legacy name: 'surf'), 'peakfcn2d' ('peaks'), or 'plot3d' ('plot3'). These functions will display the same 3D view but with a handy control panel on the side to customize the display. To get this control panel from the Probe or MathScript Window displays, all you have to do is right-click on the display and select 'Undock Window'.

 

3d.png


The interactive control panel is where the 3D graph really shines. It comes with 8 preset display modes to visualize your data in different ways. These are accessible from the 'Surface Style' dropdown menu. Once you've selected a surface style, you can customize different parameters of it using the sliders, color boxes, and menus below. Parameters include things like normals, contours, and surface color. Only the parameters that make sense for the selected surface style will be available. If you want to customize other parameters, you can change the surface style to 'Custom' and change everything about your graph.

Once you've set up the surface the way you'd like, you can customize the world that the surface lives in using the 'Environment' tab of the control panel. Here you can set things like labels, gridlines, and projections. You can even change to a perspective projection which, according to the developer of this feature, makes your data look like it's in a rap video.

Now that you've got your plot looking perfect, you can hide the control pane by clicking on the splitter bar between it and the graph display. Or you can go to the File menu and save the plot to a BMP file to use it in reports or web pages.

The MathScript 3D graph makes it really easy to create stylish renderings of your data. I encourage you to try it out!

jattas
LabVIEW MathScript R&D

ps Check out Previous MathScript Nuggets

Message 1 of 2
(10,615 Views)
Creating plots is all nice and dandy. How do you save them programmatically ? The main power of a scripting language is that it automates task. Seems strange that NI went to all the trouble of letting you create these nice plots but no way to save them without point and click (which is unrealistic if your measurement is generating tons of plots).
0 Kudos
Message 2 of 2
(10,119 Views)