nl_tokens: Generate an exact number of ticks given a domain
pl_tokens: function exact_ticks ( domain , numticks ) { numticks -= 1 ; var ticks = [ ] ; var delta = <mask> [ 1 ] - domain [ 0 ] ; var i ; for ( i = 0 ; i < numticks ; i ++ ) { ticks . push ( domain [ 0 ] + ( delta / numticks ) * i ) ; } ticks . push ( domain [ 1 ] ) ; if ( domain [ 1 ] * domain [ 0 ] < 0 ) { //if the domain crosses zero, make sure there is a zero line var hasZero = false ; for ( i = ticks . length - 1 ; i >= 0 ; i -- ) { //check if there is already a zero line if ( ticks [ i ] === 0 ) { hasZero = true ; } } if ( ! hasZero ) { ticks . push ( 0 ) ; } } return ticks ; }