Generating a Surface
This example is just to give you a feel for how easy it is to generate pretty pictures from very simple mathematical expressions. What we will do is to make two lists of numbers, take the cosine/sine of each and multiply them together in an ‘all-play-all’ fashion to generate a table of results. Then we can store this in a datasheet and plot it using the ‘Response surface’ chart type.
Making the numbers
The first thing to do is to go to the Calc tab and add a MakeTable icon from the Calculations list:
Here I have generated the numbers from 1..36, multiplied by 10, twice to use as the row and column dimensions of a generated table. The rows have the Cosine taken, the columns the Sine – you can play with other functions yourself. The generated table is stored in a datasheet called ‘surface’ – you can flip to the Data tab to check the numbers we made. Note that you don’t need to define this table in advance – GraPL will generate it automatically the first time it is needed.
To plot the shape in 3 dimensions, select the Charts tab and choose the Response Surface icon from the set of chart elements. This starts off with a default dataset of {mat} rather than data, as its natural data-structure is a matrix rather than a simple series (or vector). Change this to the name of your generated datasheet (‘surface’ in the example above) and you will see a mesh plot of the generated numbers:
It is quite hard to see the shape of the surface when it is plotted as a simple mesh, so an option is to use the Style ‘tile’ to have it drawn solid. Now you can use the 3D-rotator tool (use the ‘...’ button on the viewpoint) to swing it around so you get the best viewpoint:
As you pull the sliders, the wireframe outline follows immediately – hit Apply to see the finished chart redrawn from the same viewpoint:
Here I have checked the ‘walls’ and ‘grid’ options on Response style, and also set the Z-style to ‘Flat’ to get the labels drawn unrotated, as this viewpoint makes them quite hard to read if they are angled to match the axis. You will find that you need to experiment to get the best compromise between seeing the surface and reading the labels. Of course you can deselect the ‘Axes’ checkbox and just draw the surface, which is often the most effective solution:
You can have a lot of fun with this, but do be a little careful not to generate huge tables, at least while you are just playing with the shapes. You can always crank up the amount of memory available to GraPL (increase the MaxWS setting on the command line in the GraPL shortcut) and set it running over lunch once you have settled on the equation to be drawn. You can check how much free memory you have in the Help,About dialogue.
|