HISTOGRAMDOCUMENTATIONSteveD.LevyVersionof:August12,1983HISTOGRAMcontainsacollectionoffunctionsthatproducehistograms,orbar-charts,giventheappropriatedata.Thefunctionswillplacethebarsinawindow,andautomaticallyscalethebarstofitproperlyinthewindow.Iftherearemanyitemsinthehistogram,thewindowwillbescrollable.Allitemsarechartedhorizontally.Thispackageiscompletelyself-sufficient,anddoesnotneedanotherpackageforuse.TheHISTOGRAMpackage,whenusingthehighest-levelfunction,SHOW.HISTOGRAM,willproduceawindowwiththehistograminit.Someofthepropertiesattachedtothiswindowintheprocessare:(1)HISTOGRAM-anobjectknownasahistogram,whichisalistofitems,eachitembeingasmalllistoftheform(labelvalueheight-of-bar)wherelabelistheidentifierofthevalueyouarecharting(itmaybeastringorabitmap),valueisthevalueyouarecharting,andheight-of-baristheheight,inpoints,ofthebarinthebar-chart.(2)HISTOGRAM.BITMAP-abitmapofthehistogram.Thisisessentiallythebarchartonabitmap,andiswhatgetsbitbltedintothewindowtodisplaythehistogram.(3)HISTOGRAM.POSITION-asinglenumber.Thisistheypositionofthebottomofthehistogrambitmapinthecoordinatesystemofthewindowyouareusingfordisplay.Thisisusedbythescrollandrepaintfunctions.UsefulFunctions:Thetop-levelfunctionintheHISTOGRAMpackageisthefunctionSHOW.HISTOGRAM.Thisprocedureitselfcallsotherlower-levelbutstillusefulfunctionssuchasHISTOGRAM,whichproducesahistogramobjectfromthedata,DISPLAY.HISTOGRAM,whichdisplaysthehistograminawindow,MAKE.HISTOGRAM.BITMAP,whichproducesthehistogram.bitmapgiventhehistogramandawindow,andPRINT.SCALE,whichisaprocedurethatprintsascaleatthetopofthebitmap,anddeterminessome"smart"numberofdivisionstogiveit.Inaddition,thepackageaddsonaHISTOGRAM.REPAINTFNandHISTOGRAM.RESHAPEFN.p c/a: q r_ ^- s9}\x $br[ Y Xp V tu&'T .0Q79:L@ IU   $'+148;f>@AGSq  P!#%8+j-/57;=AF GJOQ R  'r)-0c6( ?BuHJ\P ! (#&*x0I68Ns L  f"&)` 299HZK    ()+S/1y4 ;BCFIu LG F!  /#%& .3458<9>B\EJDw %+IB v!o uA# vuw X!&(+1368:7>@iAvG?y u2#&%v u.0Q289>@C=EGJ1= <% :{  /$6%( 0^35> <?BAFFHsI8  #!$'e-.4,6 7' 5}  /qW %+O.0/239;><CEHG3 Ks #(*-B258<?DH.I2) V 0 . -+ + tf u) (,  `.(a.0H29H)& F9!J )=+.3E:-=? I$ uu#'d)->CVIe#.  27k>kA! C%()0 3 =BeCE$ ;M!#&A(*0037 ;f?E0 o   " #G582   4   q?[2SHOW.HISTOGRAM(name/value-listwindowfonttitle)Thisisthehighest-levelfunctioninthepackage.Ittakesfourarguements,thefirstbeingthedatafromwhichitwillderiveitshistogram.Thedataisthename/value-listandisoftheform:((*.*)(*.*)(*.*)....),i.e.alistofdottedpairs,thecarofeachdottedpairbeingthelabeloftheitem,andthecdrbeingthevalueassociatedwithit.Thelabelmaybeeitherastring,atom,orbitmap.Thebar-chartwillbedisplayedinwindow,ifitisprovided.Ifitisnot,awindowofappropriatesizewillbedevelopedandtheuserpromptedforaplaceforit.Thehistogramisalwaysdevelopedsothatthebarsofthebar-chartscalesothatthereneednotbeanyreasontoscrollhorizontally.Thewindowcreatedbythehistogrampackagewillneverexceed500bitswideby500bitstall.Thefontisafontforalllabelsthatarestringstobeprintedin.Ifnotgiven,itdefaultstoHELVETICA10.Titleisthetitleforthewindow,andwillbedisplayedinthetitlebaratthetopofthewindow.Thiswilldefaultto"HistogramofSelectedData"ifatitleisnotspecified.HISTOGRAM(name/value-listfont)Thisprocedureproducesthehistogramobjectfromthedata.Itispassedalistofdottedpairs,withthecarofeachitembeingthelabel,andthecdrbeingthevalue,andcreatesalistoflists,witheachsublistbeingalistofthreethings;thelabel,value,andheight-of-barforthebar-chartbar.Thefontisrequiredheregetthethirdpieceofinformation.Atthemoment,theheight-of-barisalwaysequaltothefontthatthelabelwillbedisplayedinminus2. c8a u_ ^. s uv&,.u\ Z Fd !#x&,.)2G5~ >A9D@HY0  V!# +w.136AwD~FGJ\W U  /  KO "m'L+.(026c;B>UBE=HJT2  MT $ ,/148U;=B C[H"R 8P O4   "Uvu')9*t+2435n6:;@@BM m4U"&(,3856:=K>BIgK  n5>Q $_&(/358<@CNEoHRJ6  "'-/2.9?BFH fU8!F E8  KH"%*,\.}35719>n?EG_C BvuVt c"%N+u.|1#3D:Q;>AD4EHA  Pm#H% -s/35:8;s<?A!C@: > < ;< 9 7 suv u62 4 F&+/=1568=?#ACAH 2 ,p pE $'+.1T48T:?yBHIP14  H"$#&(A,F1b38&<? I9/  ; !'+[-04'8]: BDGg- e $!(c*#,/259F;>EF,6 * ( '8 C q?[DISPLAY.HISTOGRAM(windowfont)ThisproceduredisplaysahistograminwindowbytakingthehistogrampropertyoffthatwindowandcreatingabitmapfromitbyusingMAKE.HISTOGRAM.BITMAP.Itthenbitbltsthisbitmapontothewindow.Itdisplaysalllabelsinthefontfontifitisastring.(defaultstoHELVETICA10).Itisinthisprocedurethatwesetthewindow'sSCROLLFN,REPAINTFN,andRESHAPEFN.Inaddition,weturnonscrollinginthisproceduretoo.MAKE.HISTOGRAM.BITMAP(windowfonttab1tab2tab3scalehist)Thisprocedurecreatesthehistogrambitmappropertyofthehistogram.window.Itdoesthisbycreatingablankbitmapofawidthaswideasthewindow's,andaheightthatwillbeastallasneededinwhichtodisplayallthedataplusascaleatthetop.ItprintsascaleatthetopusingPRINT.SCALEandthengoesthrougheachiteminthehistogram,startingatthebottomofthebitmap,bitbltsthelabeltox-positiontab1,thevaluetox-positiontab2,andthebarofthebar-charttox-positiontab3.Whenitfinishes,ataddssomenumber(approximatelyequaltothetallestitemofthethree,thelabel,thevalue,orthebar)toitscurrenty-position,andnowhasthey-positionforthenext"line"ofdata.PRINT.SCALE(bitmapbartabscalehistfont)Producesascaleatthetopofthebitmap(histogram),withthenumberofdivisionsinthatgridsomehowrelatedtothegreatestvalueofallthevaluesonthehistogram.Thisgridisputherefororientation. c8a u_ su`v$u^. \ F9$&Bvu+~-264<1B{DGZ   4#%'+F@7A~DIY0  B &(-.1V4uvu7R89;L<ANGIW :%(+7-0G70@ IzU   "v%'.=/2:qT2 R P O4 M~ su#'v(+.158uK J* F%*025KBD&GH  7m "U#')-\/Y19IA\DFSHP> f g!J# +!-r0 3s8 9< ;0 9 7 6& s uv9 $]&u4| 2 =OC "' 036{<@>D|F$I71(  "b"$(*,/K4+6X8 @DG;H/~  m r.& ,  q?[ HELVETICA  HELVETICA  HELVETICA  HELVETICA ~GACHA  HELVETICA~GACHA v j/di"{PHYLUM}LISP>HISTOGRAM.TED;3LEVY12-AUG-83 21:18:28