home *** CD-ROM | disk | FTP | other *** search
- !GraphDraw, © Chris Johnson, 1990
-
- These user notes refer to version 1.07 (March 1992)
-
-
- *********************************************************
-
- ACKNOWLEDGEMENT
-
- THIS PROGRAM WAS COMPILED USING THE DABS PRESS ARCHIMEDES
- BASIC COMPILER (ABC)
-
- THE CC STYLE BORDERED ICONS ARE ACHIEVED USING THE
- INTERFACE MODULE BY SIMON HUNTINGDON
-
- THE FONT MENU MODULE IS BY JORIS ROLING
-
- *********************************************************
-
-
- What this software does
- =======================
-
- It allows the entry of the x and y values for a number of
- data, and the data may then be fit to
-
- a. best straight line
- b. best parabola
- c. a cubic spline curve
- d. a polynomial of order up to 6
-
- A number of options for obtaining various forms of hard copy
- exist (saving as a sprite file, saving as a !Draw file, or
- printing via any standard RISC-OS printer driver).
-
- Use of !GraphDraw
- =================
-
- Running the application
- -----------------------
-
- This software is fully RISC-OS compatible, and is
- multi-tasking. It can be run from the desktop in all the
- standard ways.
-
- NB. The display of the graph uses outline fonts to annotate
- the axes etc.. It is therefore necessary for the operating
- system to have "seen" the !fonts directory before the
- program is run. Otherwise an error message may be generated.
- The default font used is Trinity.Medium, since this comes on
- the RISC-OS applications disc, and both old and new version
- font managers can deal with it (the new outline font manager
- will work with the old bitmapped fonts).
-
- Double clicking on the !GraphDraw icon in a directory viewer
- will install its icon on the icon bar. Clicking 'menu' on
- this icon will lead to a menu providing
-
- Info
- ....
-
- a standard information window with version number
-
- Preferences...
- ..............
-
- Selecting this brings up a dialogue box that
- allows a range of options to be changed, and
- these changes may be made permanent so
- that they become the new defaults when the
- application is subsequently started.
-
- The choices should be self explanatory. The
- font name and size can be changed. To
- change the font, simply click on the name
- field, when a menu will open with all the
- installed fonts shown, from which a choice can
- be made. Clicking on either of the size icon
- fields will place the caret ready to enter the
- new size. The type of point symbol (size and
- whether filled) used for the graph can be
- changed by clicking on the appropriate
- buttons. The changes will not come into
- operation until the OK button is pressed. If the
- cancel button (or the window close icon) is
- pressed, the dialogue box is removed from the
- screen, and the original defaults remain in
- effect. The selection can be made the new
- default by clicking on the save icon. (This
- option is NOT available when the application
- is running over econet). Note that the default
- file is saved within the !GraphDraw application,
- therefore, if the application is being run from a
- floppy disc, the filer may request the disc
- containing the !GraphDraw application to be
- inserted in the disc drive.
-
- File format
- ...........
-
- Graphdraw by default assumes that data files to be
- loaded are essentially in CSV format. It is
- possible to change the data field separator that
- graphdraw looks for in input files to TAB, space
- or any other ASCII character. When graphdraw saves
- a data file it always uses the COMMA as a
- separator.
-
- Quit
- ....
-
- the opportunity to quit the application.
-
-
- Clicking SELECT on the iconbar icon will open an
- empty edit window, into which the pairs of x,y
- data may be entered. This version allows a maximum
- of 200 data point pairs. Full scrolling and
- editing facilities are available during data
- entry, by means of the arrow keys, either alone or
- in conjunction with SHIFT or CTRL. Page up/down
- are the same as SHIFT+arrow. One useful key
- combination is CTRL+SHIFT+COPY, which will delete the
- data point at the cursor and close up the rest of the
- data. The function key f3 will bring up the standard
- save as dialogue box (as provided also as a menu
- choice).
-
- The application can also be started by double clicking on a
- data file of the correct format. In this case, besides the
- icon appearing on the icon bar, the edit window will be
- opened with the contents of the data file displayed, for
- further editing if necessary. A data file may also be
- dragged, either into the edit window, or to the iconbar
- icon. The data will be loaded, overwriting any data that had
- previously been entered.
-
- Data can also be passed in either direction between the
- GraphDraw edit window and a !edit window. Thus editing can
- be carried out using the !edit application if preferred.
- Data can be entered 'from scratch' using !edit, and then
- transferred to the !GraphDraw application (by dragging a
- save icon to its edit window or its iconbar icon), as long
- as the !GraphDraw application can recognise a valid data
- file. This version of !GraphDraw takes the easy way out and
- uses the <wimp$scrap> file passing protocol with a temporary
- disc file. Users of single floppy disc machines may be
- prompted for the disc on which the <wimp$scrap> file is to
- be saved (by default in the !system directory). [HINT: It is
- possible to redirect the <wimp$scrap> file to the RAM disc,
- for example. This will prevent disc swapping, and is very
- fast. It requires that a RAM disc is always configured.] It
- is intended that the next version will use direct memory
- transfer for these operations. As the graphdraw application
- will deal with files of comma separated ASCII data it is
- possible to set up other applications to produce data files
- of the correct form.
-
-
- The !GraphDraw edit window menu
- ===============================
-
- All of the data processing and data display facilities are
- accessed from the edit window menu.
-
- Clicking the 'menu' button in the edit window brings up the
- following choices.
-
- Info
- ----
- The standard information window.
-
- Clear data
- ----------
- This will irretrievably clear the current data prior to the
- entry of new data.
-
- Save file
- ---------
- Data files may be saved by dragging the save icon to a
- directory viewer. If the full path name is set up, then you
- can also click on the OK icon to save the data.
-
- The function key F3 can be used as a short cut for this
- option (unless the graph window is open, when F3 will
- bring up the "save drawfile" dialogue box).
-
- It is also possible to drag the save icon to a !Edit window,
- or to the !Edit icon on the iconbar. The data is then
- transferred into !Edit.
-
- Plot points
- -----------
- This will simply plot a scaled graph of the data.
- Additional sub-menu choices allow you to plot the data
- as is, as semi-log x, semi-log y or as a log-log plot.
-
- Join points
- -----------
- This plots the points and joins each point to the next
- with a straight line. The log plotting options are
- available as above.
-
- Best line
- ---------
- This will carry out a standard linear regression by the
- least squares method to calculate the best fit straight line
- through the data. A window will open displaying the slope,
- intercept on y axis, correlation coefficient and the
- standard errors of the slope and intercept. Clicking 'menu'
- in this window allows the following choices.
-
- Graph
- -----
- This will display a graph of the data points with the
- calculated best line superimposed. Clicking 'menu' in the
- graph window leads to a further set of options (see below
- under cubic spline).
-
- Print data
- ----------
- This will send the results of the calculation to any
- printer connected to the computer. The individual errors
- calculated for each data point are also printed.
-
- Parabola
- --------
- This will carry out a least squares fit of the data to the
- equation of a parabola
-
- y = u + vX + wX^2.
-
- This is a useful technique for fitting data to a simple
- curve. A window will open showing the calculated values of
- the coefficients u, v and w. Clicking 'menu' in this window
- will bring up the same two options as described above, i.e.
- graph and Print data.
-
- Polynomial
- ----------
- This will carry out a standard polynomial fit for orders 3
- to 6. Some of the higher order options may be greyed out if
- there are not enough data points. Selecting a particular
- order will force the program to calculate that specific
- order polynomial, whereas if 'All' is selected, the program
- will try all possible orders (3 to 6) and report the one
- which gives the smallest deviation. A window will open
- showing the results of the calculation, and clicking 'menu'
- on this window leads to the same options as above.
-
- Cubic spline
- ------------
-
- This option leads to a small dialogue box, which
- at present simply requests the 'fit factor' to be
- specified. This value must lie BETWEEN 0 and 1. In
- theory, a value of 0 will plot a straight line
- through the points, while a value of 1 will force
- the curve through every point. In practice these
- values cannot be used, since a divide by zero
- error is generated during certain matrix inversion
- operations. Little is lost since a value of 0.9999
- or 0.0001 will give essentially the same result as 1
- or 0. Curve fitting is always very subjective, and
- it is up to the user to decide what degree of
- smoothing is acceptable for any particular set of
- data. A value of 0.5 is an obvious starting point
- for any data known to have scatter or experimental
- error.
-
- Once <return> is pressed, the spline plot will be
- displayed. For this plot, it requires all the data
- to be sorted in order. The program automatically
- sorts the data in ascending order of x values
- before carrying out the spline routine. Note
- that this sorting occurs whenever any of the plotting
- routines are used.
-
- Transform X
- -----------
-
- Allows the x data to be transformed in a number of
- standard ways, e.g. LOG, reciprocal. These operations
- are cumulative, but it is up to the user to remember the
- sequence of transformations.
-
- Transform Y
- -----------
-
- As for transform X but on the y data.
-
- Swap X and Y
- ------------
-
- Simply interchanges the x and y data pairs.
-
-
- Graph window menus
- ==================
-
- Whenever a graph is being displayed, clicking 'menu' will
- lead to a further range of options. Some of these are common
- to all the graph types, others are specific to cubic spline.
- Rather than repeat the same thing several times over, all
- the common options are dealt with here.
-
- The common options
- ------------------
-
- Screensave
- ----------
- This saves either the graph window or the whole screen
- as a sprite, which can then be loaded into !Paint, or
- !Draw for example. The screen can be printed from either
- of these utilities using the RISC-OS printer drivers.
- There is no choice in filename - it saves in the current
- directory using grafwinN, where N is a decimal number
- which increments with each save. It defaults to 1 each
- time the program is run, thus any existing files from a
- previous session will be overwritten if there are any in
- the current directory
-
- Legend
- ------
- This opens a window which allows you to enter text to label
- the graph axes, and a title string for the graph. Clicking
- on display will place the labels on the graph, while delete
- will remove labels from the graph (the text remains in
- memory and can be reinstated by reselecting label and
- clicking on display). Simply closing the menu will leave the
- state of the labels as they were.
-
- The labels are dragable icons and can thus be dragged to
- anywhere on the graph if you dont like the default
- positions. The same labels will appear on any graph, with
- the previous position being remembered. The y-axis label
- may be plotted either horizontally or vertically,
- reading downwards. The latter is something I am not too
- sure about as far as the aesthetics of display are
- concerned. I have not yet worked included routines to
- rotate outline font text through 90 degrees so that it
- reads up the axis! [HINT: If you have FontFX, then you
- can use this to convert the outline font to draw files
- that can be rotated. Save the graph as a draw file, and
- then import the y-axis legend from FontFX. Another
- alternative is !DrawPlus - Use a horizontal label, and
- then convert to a path once in Drawplus and rotate 90
- degrees.]
-
- If data is saved after legends have been entered, then the
- text is also saved, and is reloaded when the data is
- reloaded.
-
- Layout
- ------
- This leads to a dialogue window in which various aspects
- of the way the graph is laid out may be changed, e.g.
- whether the axis pips are inside, outside or straddle
- the axis lines, the size of the pips, whether the graph
- is boxed in, and the type of symbol used for the data
- points. It is now possible to over-ride certain of the
- automatic plotting features (e.g. the axis range). These
- aspects are under continuous development, and will be
- enhanced in future releases.
-
- Make Drawfile
- -------------
- A standard 'save as' dialogue box will be opened. The file
- icon may be dragged to a directory viewer, or if the full
- filename path is set up it is possible to click on OK. The
- file saved is a Drawfile of the graph being displayed. This
- file can then be loaded into !Draw for further enhancement.
- It is also permissible to drag the file icon into a !draw
- window to add the graph to an existing draw document, or
- drag the icon to the !draw icon on the iconbar, when a new
- draw window will be opened. These latter operations make use
- of the wimp$scrap protocol in the present version - direct
- memory to memory transfer is to come! The production of
- !Draw format files means that the graphs can be loaded into
- !Draw for enhancement, and can also be loaded into the
- various DTP packages now available (it certainly works for
- Acorn DTP and Beebug's Ovation packages).
-
- When it is first loaded into !draw, the whole graph appears
- as one object, and may be scaled, moved, etc. as a whole.
- The line thickness may be changed, etc. The objects
- making up the graph may be ungrouped in the normal way.
- This allows adjustment of individual parts of the graph,
- or annotation. It needs care when dealing with the
- individual parts of the graph, otherwise you may
- inadvertantly move parts of the axis for example, or
- even the graph itself, and have great trouble getting it
- back to the correct place.
-
- If you are familiar with using !draw, then it should be easy
- to play around with the draw files output by !graphdraw.
-
- If the graphdraw edit window has input focus, then the
- function key F3 may be used as a short cut for this
- option.
-
- Make plotfile
- -------------
- This will output a data file of the points AND the
- current fitted line in a form suitable for loading into
- the MultiPlot application. (If only the points have been
- plotted, then only the points will appear in the
- multiplot file). This has the same look and feel of
- graphdraw, but allows the combining of up to 6 sets of
- line and point data onto the set of axes. Multiplot
- deals only with the graphical display, it has no data
- entry or processing facilities. It will accept plotfiles
- from a number of applications besides graphdraw. Contact
- the author for information.
-
- Print Graph
- -----------
- Choosing this option gives a printout of the complete graph
- via whichever printer driver application is installed. A
- printer driver must be installed, otherwise !Graphdraw will
- complain. This allows a much higher quality hard copy to be
- obtained compared to a simple screen dump, up to the best
- available resolution of the printer used. The "Print"
- key may be used as a short cut if the edit window has
- input focus.
-
- Cubic Spline option only
- ------------------------
-
- Interpolate
- -----------
- This option is available ONLY from the cubic spline graph,
- and allows the interpolation of single values, or the
- dumping of a range of values to the printer. Note that it is
- not possible to extrapolate the spline curve beyond either
- of the end points.
-
- *************************************************************
-
- For anyone who registers, and is interested, I also have an
- application very similar in format and operation to
- !GraphDraw, but which does a parameterised least squares fit
- of the data to any function which can be entered in BASIC
- format. It makes use of BASIC's EVAL function to do all the
- hard work. The function can contain up to TEN parameters.
-
- This allows you to fit data to logarithmic, exponential, or
- trigonometric functions. All graph plotting, printing and
- draw file production uses the same routines as !Graphdraw.
- However, as it contains the EVAL function it cannot be
- compiled, and so runs a little slower.
-
- *************************************************************
-
-
- The software referred to in these notes is NOT placed into
- the public domain, but remains the copyright of the author,
- Chris Johnson. It is released for distribution by Norwich
- Computer Services under their Shareware/Careware scheme
- only, and should not be posted on bulletin boards or
- circulated on any public domain software discs, except by
- prior and express agreement with the author, or with Norwich
- Computer Services.
-
- Anyone obtaining this software by any means other than by
- direct purchase from Norwich Computer Services, or from the
- author, and making use of the software other than for trial
- purposes, is requested to register with the author by
- sending £3 (most of which will find its way to an approved
- charity), or to send a donation to charity directly to NCS.
- All users registering directly with the author will be
- informed from time to time of any significant improvements
- or 'bug' fixes and will be entitled to upgraded versions of
- the software free of charge at any time by sending a
- blank disc.
-
- The software is supplied as is, and no warranty, either
- express or implied, is given as to the suitability of the
- software for any purpose.
-
- Notwithstanding the above, the author would, of course, be
- interested in hearing of any 'bugs' or any other unexpected
- features, and will endeavour to correct any such 'bugs' so
- reported in any future issues of this software. Suggestions
- for improved features are also most welcome. Implementation
- of suggestions depends of course on practicability and more
- importantly, the authors spare time (I do have a full time
- job!).
-
- If you have any comments on this program, or would like to
- suggest ways in which it could be improved then the author
- can be contacted directly.
-
- Chris Johnson
- 7 Lovedale Grove
- Balerno
- Edinburgh
- EH14 7DR
-
- If you have access to the JANET e-mail system then you
- can try
- checaj@uk.ac.hw.clust
-
- If you wish to enter into the 'shareware' concept in the
- full sense then registrations (>=£3) will be gratefully
- received by the author.
-
- If, in any communication, you make specific reference to the
- program code, then please
-
- (a) quote the version number and date
-
- (b) refer only to the program as issued.
-
- (c) supply as many details as possible about the
- problem, and indicate the hardware configuration of
- the machine being used.
-
- PLEASE SEND A STAMPED AND SELF ADDRESSED ENVELOPE IF YOU
- REQUIRE A REPLY.
-
- I hope you find the program of some use.
-
- CafJ 10/03/1992
-
- Note: If you are using an A5000, you will find some of
- the writable icons look a little odd. This appears to be
- an interaction between RISC-OS 3 and the version of the
- Interface module that I use. If you have this problem
- then I can supply a version with slightly modified
- templates with standard writable icons to remove the odd
- bordering effect.
-
-
-