(* This is a jgraph of the sending of messages in a multicomputer over a period of time. It is a good mixture of picture drawing and graph- drawing: Note that hash marks and a legend is employed, as is the drawing of multiple arrowed lines, and some text. *) newgraph (* Draw the three time lines with hash ticks. Only draw hash labels on the bottom-most one *) yaxis size 1.6 min 0 max 2 nodraw xaxis size 4.5 min 0.5 max 10.5 nodraw draw_hash_marks draw_hash_labels draw_axis_label hash 1 mhash 0 shash 0 hash_scale -.4 label : Time copygraph xaxis draw_at 1 nodraw draw_hash_marks copygraph xaxis draw_at 2 (* Reset the axes to draw the picture *) copygraph xaxis size 4.5 min 99.5 max 109.5 nodraw (* Define the legend entries *) newline linethickness .5 linetype dashed rarrows asize 0.19 0.04 label font Times-Italic : mCL Marker copycurve linetype dotdash label : mNSmarker copycurve linetype dotted label : mS Message copycurve linetype solid label : Normal Message legend linelength 1 (* Draw each process's time line arrow *) newline linethickness .5 rarrows pts 99.5 0 109.5 0 copycurve pts 99.5 1 109.5 1 copycurve pts 99.5 2 109.5 2 (* Draw the time line processor labels *) newstring fontsize 9 hjl vjc x 99 y 2 : Pc copystring y 1 : P1 copystring y 0 : P2 (* Draw the initial broadcast of mcl messages *) newline linethickness .5 linetype dashed rarrows asize 0.19 0.04 pts 100 2 102 1 copycurve pts 100 2 102 0 (* Draw Message from p2 -> p1 *) copycurve linetype solid pts 101 0 103 1 (* Draw mns messages to p1 *) copycurve linetype dotdash pts 100 2 104 1 copycurve pts 102 0 104 1 (* Draw Message from p2 -> pc *) copycurve linetype dashed pts 105 0 106 2 copycurve linetype solid pts 105.1 0 106.1 2 (* Draw mns messages from p1 *) copycurve linetype dotdash pts 104 1 107 0 copycurve pts 104 1 107 2 (* Draw mc's -> pc *) copycurve linetype dotted pts 104 1 108 2 copycurve pts 107 0 108 2 (* Draw mc from pc *) copycurve pts 108 2 109 1 copycurve pts 108 2 109 0 (* Draw labels for m and m' *) newstring fontsize 9 font Times-Italic x 102.05 y .5 hjl vjt : m copystring x 105.6 y .75 hjl vjc : m' copystring x 105.6 y 2.15 hjr vjc : Pc doesn't log m' copystring x 103.4 y 1.35 hjl vjb : P1 logs m copycurve linetype solid pts 105.7 2.15 106.1 2 copycurve pts 103.38 1.32 103 1