This is the code for Chapter 4, Figure 4 from D3.js in Action showing how to create a scatterplot using scales and d3.extent() to calculate min and max values for data.