US Coloring Books



    PLOT USCOLORINGBOOK
        LAYER, COLOR OVERRIDE
      WITH
        BACKGROUND GRAY
        FOREGROUND WHITE
        NO YAXIS
    SELECT
        'states_map', 'very light blue'
    UNION
    SELECT
        'pennsylvania', 'light red';

Entrance “coloring books” paint colors on a background image, based on query results. The example above has painted Pennsylvania light red and the rest of the US light blue.

Coloring books expect the LAYER column to contain region or layer names and COLOR OVERRIDE to contain colosr like RED, BLUE and so on. In the case of a USColoringBook, provide state names with any spaces removed, eg. “california”, “northdakota”, “newyork”.

Using USCOLORINGBOOK, we can make a Red-Blue states map:



    PLOT USCOLORINGBOOK
        LAYER, COLOR OVERRIDE
      WITH
        PAGE 0 0 400 200
        NO YAXIS
    SELECT
        state, IF(winner LIKE '%obama%',
          'skyblue', 'scarletred')
        FROM election_results;

Comments are closed.