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ï_âî êï^-î êsî9î}ï\xî êîìî™î$îbrï[ î êïYÈî êïXpî êïVÅî êtuî¶î&î'T î.‘î0Qî79î:Lî@Š îIïUî êî  îÌîöî� î$î'ôî+î1ïî4–î8Ìî;fî>Úî@‚îA½îGäïSqî êî ñ î¤î¶îPî!Äî#„î%8î+jî-î/¬î5Óî7î;î=ÅîAïîF îGµîJOïQÇî ê î¸îRî î³îÔ î'rî)Ÿî-½î0cî6( î?îBuîHØîJ\ïPî ê îéî!î (î#ñî&—î*xî0Iî6¬î8ýïNsî êïLÉî êî ýî–îfî"�î&Æî)` î2¦î99îHZïKî êî ‘îÏî îÄîî ¢î(î)«î+Sî/¹î1yî4 î;˜îBîCßîFÂïIuî êî¤îLîæîÜî‚ïGËî êïF!î êî /îÈî®îÏîŠî#Žî%‹î&Æ î.”î3î4£î5Þî8<î9üî>‡îB\îE¸îJïDwî êî %î+î‰îIîãïBÍî êîàîÖîÌvî´î!o uïA#î êvî�îóuîwî î˜îXî!òî&î(ÿî+¥î1×î3—î6Ûî8üî:7î>‘î@iîA¤vîGµï?yî êuî®î2îÌîêîÙîî#î&%v uî.Íî0Qî2ëî8î9Çî>ãî@£îC=îEïîG—îJ1ï=Ïî ê ï<%î êï:{î êî /îíîÓîî$6î%öî(� î0^î3ºî5> î<õî?�îBAîFFîHsîI®ï8Ñî êîî†î îÇî#î!Äî$Ëî'eî-î.ßî4,î6Æ ï7'î êï5}î êî /îqîWî ’î%î+Oî.«î0/î2Éî3ìî9âî;¢î><îCˆîEHîGâï3Óî êîKîsîîµ î#§î(èî*¨î-Bî2üî5ëî8‘î<Çî?îDÒîH.îI²ï2)î êî³î¼îVîŒî“îß ï0î êï.Õî êï-+î êï+€î êtîf uï)Öî êï(,î êî ýî`î†î.îÈî(aî.Äî0Hî2âî9îH)ï&‚î êîFîïî î9î!J î)=î+ãî.¢î3Eî:-î=öî?ó îIùï$Øî êîuîuî°îî#Ìî'dî)þî-ßî>ËîCVîIeï#.î êî „îåî�îÈîïî2àî7kî>kîAï!„î êîî©îCî%¤î(«î)æî0 î3 î=ÚîBeîCéîE$ïÚî êî“î¦îî;îMî!î#›î&Aî(î*›î00î37 î;fî?�îE’ï0î êî¯îoîëî«îïï†î êïÜî êî žîî³îîßî" î#Gî5Úî8áï2î êïˆî êïÞî êï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.î êïc8ïaŽî êuï_äî êï^.î ês uîvî&èî,î.ïuï\„î êïZÚî êîFîÊîd îªî!Ðî#xî&î,âî.)î2Gî5~ î>ŸîA9îD@îHŽïY0î êî „îøî�îîVîýî!¬î#© î+wî.Šî1þî3‚î6îAwîD~îFîGÂîJ\ïW†î êïUÜî êî /î ýîîêî î×îKîžîîOî ­î"mî'Lî+Žî.(î0Îî2Žî6cî;Bî>UîB£îE=îHúîJºïT2î êî „îMîTîîî îîî ˆî$¦ î,™î/Ýî1…î4˜î8Uî;™î=ºîB îC[îH"ïRˆî êî8îïPÞî êïO4î êî ýîØîî î ­î"Uvuî'þî)9î*tî+øî2ìî43î5nî6òî:î;@î@úîBºïMŠî ê îmî�î4îUî"ÿî&î( î,î38î5‰î6Äî:úî=Kî>óîBîIgïKàî êî nî‹î5î>îQî ëî$_î&î(¹î/”î3¦î5¯î8Âî<Çî@¨îCNîEoîHRïJ6î êîîÞî îî"î'Òî-‹î/”î2.î9�î?òîB™îFçïHŒî êîfîUî8îÝîæîÕî!¸ïFâî êïE8î êî ýîî îÛîúîKîHîÇî"Úî%€î*œî,\î.}î3Õî5êî71î9×î>nî?©îEŸîG_ïCŽî êîÀîBvuîVîÚîtî cî"´î%Nî+uî.|î1#î3Dî:Qî;ùî>“îA‚îD4îEèîH‚ïAäî êî �îPîêîîmîî#Hî% î-sî/3î5ºî:8î;sî<®î?�îA!îCÇï@:î ê ï>�î êï<æî êï;<î êï9’î êï7Üî êsuîvî ßuï62î êï4ˆî êîFîïîïî‰î&êî+¥î/=î1×î5¸î6ÿî8ƒî=èî?#îA�îCAîH ï2Þî êî,îpî î°îpîEî ¡î$ïî'‰î+³î.ºî1Tî4î8Tî:îî?yîB€îHîIPï14î êî Hîî•îÙî®îšî"èî$#î&�î(Aî,Fî1bî3üî8&î<±î?¸ îI9ï/Šî êî ;îÕî°îÏîâî î!…î'Ïî+[î-õî0�î4'î8]î: îBéîDÍîGgï-àî êîeîÿ î€îî$!î(cî*#î,½î/Üî2ïî5‰î9Fî;íî>îEîFÃï,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.î êïc8ïaŽî êuï_Øî êsuî`vî$uï^.î êï\„î êîFîïîþî9î$šî&Bvuî+~î-‡î26î4Ðî<1îB{îD´îGÇïZÚî êî¤î«îÑî î 4î#Ìî%î'î+Fî@7îA~îDþîI¡ïY0î êî Íîõî�îîBî ‰î&˜î(•î-î.¼î1Vî4uvuî7Rî8�î9Èî;Lî<‡îANîGÉîI‰ïW†î êîÀîÇîî’î:îî%Æî(Ùî+7î-­î0Gî70î@ îIzïUÜî êî ñ îéî�î î"vî%­î'Úî.=î/åî2Èî:qïT2î êïRˆî êïPÞî êïO4î êïM~î êsuî#'vî(ßî+³î.Óî1óî5î8ÂuïKÔî êïJ*î êîFîïî„îî%î*§î0ñî2±î5KîBßîD&îGïïH€î êî ÍîÖîüî7îmî •î"Uî#�î'ºî)·î-\î/Yî1óî9IîÂîA\îD“îFSîHPï>„î êîf îîîgî!Jî#ä î+!î-rî0 î3sî8 î9Êï<Úî êï;0î êï9†î êï7Üî êï6&î ês uîüvî9î ®î$]î&ûuï4|î êï2Òî êîî=îOîî�îCî î"�î'Å î0�î3áî6{î<@î>îD|îF$îI7ï1(î êî î"îbî"î¼î$Öî(ôî*´î,±î/Kî4+î6Xî8ò î@ÀîDîG;îH¿ï/~î êî �îîm rï.&î êï,Îî êÿÕ êq?€[Ç‚ HELVETICA  HELVETICA  HELVETICA  HELVETICA ~GACHA  HELVETICA~GACHA v€ �j/ÿÿ›di¸ÿÿÿÿÿÿ"{PHYLUM}LISP>HISTOGRAM.TED;3LEVY12-AUG-83 21:18:28