Skip, Though not exactly what you asked for, Stemplots were designed to do a very similar thing and are discussed at the following link.
http://code.jsoftware.com/wiki/User:Brian_Schott/Stemplot Based on your example and the code at that link, the following jconsole session produced a result much like yours. a=: 9 12 2 20 14 11 13 15 7 5 3 19 8 1 4 16 10 6 18 17 stem =: <.@(%&10) :. (10&*) NB. generalized in stemGen below sort=: /:~ sortleaf=: |@/:~ NB. sort leaf stem =: <.@:(%&10) :(<.@: %~ ) leaf=: (* * 10&|@|)@] stemNub=: (10 * ~.@:stem) : ([ * ~.@:stem) SLtab=: stemNub ;"0 stem sortleaf each@</. leaf SLtab sortleaf a +--+-------------------+ |0 |1 2 3 4 5 6 7 8 9 | +--+-------------------+ |10|0 1 2 3 4 5 6 7 8 9| +--+-------------------+ |20|0 | +--+-------------------+ 5 SLtab sortleaf a +--+---------+ |0 |1 2 3 4 | +--+---------+ |5 |5 6 7 8 9| +--+---------+ |10|0 1 2 3 4| +--+---------+ |15|5 6 7 8 9| +--+---------+ |20|0 | +--+---------+ There are differences, but the spirit is similar. Jimmy Gauvin's answer is much more of what you wanted, I suspect. -- (B=) <-----my sig Brian Schott ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm