Search Locate Previous Next Contents

Checkweigher Calibration

This short article shows how easy it is to mix two quite separate chart types in the same plotting space, and using the same axes. It also shows you a little more of the formatting language, for example how to position headings and add notes to your finished graphic.


The data is typical of an experimental run of test packs over an automatic weigh-scale. Packs are made up at various exact weights and repeatedly passed over the scale (50 times in random order); the number of rejects at each weight is counted. A perfect device would reject everything below the set point, and accept everything above – but of course the edge is fuzzy and the 50% reject point is rarely where the dial says it is! In order to find the ‘safe’ set point so that no illegal packs are passed (with a pre-determined probability such as ‘no worse than 1 per 1000’) we need to model the data with a simple curve such as the logistic function. The chart shows how closely the computed function matches the data.

Here is the code which drew it:

 R„Checkweigher;PACK;EXP;FIT 
© VECTOR checkweigher example 
 PACK„219+¼13 
 EXP„50 47 45 38 24 16 15 8 2 0 1 0 0 
 FIT„50×÷1+*(PACK-224.48)÷1.31 
 chSet('Style' 'cbar,boxed')('hmar' 60 36) 
 chSet('Head' 'Fit of Logistic Curve;to Checkweigh Data')
   ('Key' 'Experimental Data,Logistic Fit') 
 chSet('Hstyle' 'right')
   ('Xcap' 'Weight of Test Pack(g)')
   ('XLAB'('I3'ŒFMT PACK)) 
 chSet'Ycap' 'No of rejects (out of 50)' 
 chBar EXP ª chPlot FIT 
 chNote'Deduced Set weight = 224.48g;Uncertainty = 1.31g'(8 40) 
 PG„chClose 
 R„'View PG © to see it'

The new points to note in this example are the two plotting calls (chBar and chPlot) and the addition of a note with chNote at position (8,40) after the plot has been drawn.



Continue to: Drawing a Population Pyramid
© Copyright Causeway Graphical Systems Ltd 2003