Log Axis with Zero
A log axis with zero uses a secondary ordinal scale to render the value 0 below the main logarithmic scale, which otherwise would place zero at negative infinity. The example shows a horizontal axis with major ticks from 1e-1 to 1e4, plus a separate zero tick offset slightly to the left. It uses d3.svg.axis with a d3.scale.log for the main axis and a d3.scale.ordinal for the zero position, drawing both as SVG groups. The discontinuity is visually encoded by separating the zero tick from the logarithmic scale’s continuous range.
AI-generated descriptionYou might reserve a special place to render zeroes when using a log axis, since normally these will be displayed at infinity. However, since this represents a discontinuity in the encoding, it’s important to show the discontinuity visually.