Coloring Polygons Based on a Column

If you’d looking to quickly style your map without resorting to CartoDB or D3, you could definitely do worse than QGIS.

Step One: Open Up Your Data

Add your layer(s) using Layer > Add Layer > Add Vector Layer (or however you’d like to do it). I’m styling a shapefile of New York City school districts based on after-school program enrollment.

Step Two: Check Your Fields

Right-click your field, then select “Open Attribute Table” to see what columns you have to work with.

I think ENROLLMENT would be a good one to work with.

Step Three: Get to the Style tab

Right-click your layer again and select Properties.

Now from the left-hand tab selector, pick Style.

Step Four: Set some styles

In the upper left-hand corner where it currently says Single Symbol, change the dropdown to read Graduated. This means we’re going to change the color gradually based on a column.

  1. Select ENROLLMENT for the column to base the color on.
  2. Change Mode to Quantile
  3. Change Classes to 7
  4. Click Classify. A few rules will appear in the area below.
  5. Play around with Mode and Classes to see how the boundaries change between colors.
  6. When you’re satisfied, click “OK”

To learn more about modes, check out Graduated Color Modes.

Step Five: Bask in glory

Looking good! Feel free to hop back into the Styles tab to change the mode, or even manually set the color bands.

Step Six: Next steps

Maybe you’d like to learn about Graduated Color Modes or how to export an image from QGIS.

Want to hear when I release new things?
My infrequent and sporadic newsletter can help with that.