FIX: xlim can be a 1d array.
BUGFIX: ensure no zero-length arrays are ever returned.