Commit 4002c4aa authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add an example to the 'Color Maps' page

parent e6e9bf5f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -18,11 +18,11 @@
  <text x="92.921007" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000"></text>
  <text x="163.032118" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000"></text>
  <text x="233.143229" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000"></text>
  <text x="303.254340" y="62.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁴</text>
  <text x="373.365451" y="62.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁵</text>
  <text x="303.254340" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁴</text>
  <text x="373.365451" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁵</text>
  <text x="443.476562" y="62.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁶</text>
  <text x="513.587674" y="62.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁷</text>
  <text x="583.698785" y="62.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁸</text>
  <text x="513.587674" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁷</text>
  <text x="583.698785" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁸</text>
  <text x="653.809896" y="62.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2⁹</text>
  <text x="721.475694" y="62.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2¹⁰</text>
  <text x="791.586806" y="65.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">2¹¹</text>
+1 −1
Original line number Diff line number Diff line
@@ -42,5 +42,5 @@
  <text x="221.731771" y="55.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10¹</text>
  <text x="439.398438" y="55.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10²</text>
  <text x="657.065104" y="55.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10²</text>
  <text x="874.731771" y="52.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10⁴</text>
  <text x="874.731771" y="55.733333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10⁴</text>
</svg>
 No newline at end of file
+10 −7
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ currently implemented mapping methods:
  - `steps` -- Map values in [0..1] to a set of discrete colors
  - `gradient` -- Map values in [0..1] to a linear color gradient

#### Syntax:
### Syntax:

    ;; a 'step' color map
    (steps (<step> <color>)...)
@@ -16,15 +16,18 @@ currently implemented mapping methods:
    (gradient (<step> <color>)...)


#### Examples:
### Example

Below you can see simple scatter plot that uses a red to blue color map to display a third
data dimension. The full source for this example is at:
[`examples/charts-basic/scatterplot_colors`](/examples/charts-basic/scatterplot_colors)

[![scatterplot_colors.svg](/examples/charts-basic/scatterplot_colors.svg)](/examples/charts-basic/scatterplot_colors)

The color map specification used in the example is:

    ;; gradient from red to blue
    color-map (gradient (0 #f00) (1.0 #00f))

    ;; step from red to green, blue, red, green to blue
    color-map (steps (0 #f00) (0.2 #0f0) (0.4 #00f) (0.6 #0f0) (0.8 #f00) (1.0 #00f))

For another example, see:
[`examples/charts-basic/scatterplot_colors`](/examples/charts-basic/scatterplot_colors)