Contour Plot II
✓ Published0🌍 Public
Mmbostock
Last edited Mar 6, 2019
Created on Apr 6, 2017
This example visualizes the Goldstein–Price function, a common test function for optimization, as a set of 20 logarithmic contour levels. The contours are drawn with SVG paths, each filled with a color from the YlGnBu interpolated color scale to indicate value. The underlying grid of 240×125 values is computed by sampling the function across its domain. The code uses `d3.contours` to generate the contour geometry, `d3.geoPath` with `d3.geoIdentity().scale()` to project the coordinates to the SVG canvas, and a `d3.scaleLog` for threshold mapping.
AI-generated descriptionAn example of d3-contour.
gpl-3.0 Licensed