GraPL > GraPL Desktop > Tutorials > Playing with numbers > Making an Egg
 

Making an Egg

A simple beginning

It is not always necessary to type in your numbers! The previous tutorial showed you some of the simple arithmetic you can do with data sheets, and the examples developed here take this idea to its logical conclusion by having the computer generate all the numbers for us. The main use for this is simply to make nice diagrams of mathematical curves, or of course to have fun with pretty 3D surfaces.

Let’s start just by drawing some simple x-y plots, for example a plot of y=x^2 for the numbers from -20 to 20:

Why bother with a data-sheet when you can just have GraPL do the sums on the fly? Here is another example which uses the Sine and Cosine functions to plot a circle:

OK, I admit it, it’s more like an egg, particularly as I checked the ‘filled’ style to have GraPL shade the area inside the line. If we had taken the trouble to make the paper square and set equal margins, we could really make a circle here – GraPL is actually quite a high-precision drawing machine if you print out your charts on a good-quality printer. Just to show that it can be done, here is a truly circular (unfilled) circle:

It looks better with the axes crossing at the centre, which is easily achieved by dragging over the x,y-intercept properties and changing (auto) to 0 for both of them. Notice the use of a semi-colon in the heading to get it split over 2 lines.

Playing games in 3D

So far, all the charts we have done have been simple 2D plots, as it is actually quite unusual to find data which is better plotted in 3 dimensions. OK, tower charts look pretty, but actually a grouped barchart is a far better way of comparing the numbers! However if you are trying to visualise the shape of some mathematical function of 2 variables, you really need to plot the z-values against x and y as a genuine 3D surface. GraPL allows you to do this very easily, and once you have your 3D chart you can spin it around to view the shape from any angle.


Continue to: Generating a Surface


© Copyright Causeway Graphical Systems Ltd 2000-2007
Telephone: +44 (0)1439 788413