Axis labeling algorithms



I have a graph where the X axis may range from 0-10 -->  0-10,000.
 I'd like to draw decent tic marks for this.  Does anyone have a
 favorite algorithm they'd like to share?
 Thanks
 --Aubrey McIntosh