! ! sub_box sets an individual box (&1,&2) in an x y grid of boxes. ! Input global variables for setup: ! - n_box[2] is the number of cells in each axis ! - big_box[4] is the plotting area. ! - big_view[4] is the used viewport to be equally divided in cells ! (defined relative to the plotting area ! - sub_view[4] is the viewport in each cell (relative to cell area) ! call: @sub_box.greg i j ! send the BOX command for box # i,j ! define integer ij[2] let ij &1-1 &2-1 define real dbox[2] sbox[4] let n_box max(n_box,1) define real area[4] let area[1] big_box[1]+big_view[1]*(big_box[2]-big_box[1]) let area[2] big_box[1]+big_view[2]*(big_box[2]-big_box[1]) let area[3] big_box[3]+big_view[3]*(big_box[4]-big_box[3]) let area[4] big_box[3]+big_view[4]*(big_box[4]-big_box[3]) let dbox[1] (area[2]-area[1])|n_box[1] let dbox[2] (area[4]-area[3])|n_box[2] let sbox[1] area[1]+(sub_view[1]+ij[1])*dbox[1] let sbox[2] area[1]+(sub_view[2]+ij[1])*dbox[1] let sbox[3] area[3]+(sub_view[3]+ij[2])*dbox[2] let sbox[4] area[3]+(sub_view[4]+ij[2])*dbox[2] set box sbox[1] sbox[2] sbox[3] sbox[4] return