4

I'm using QGIS, but I am quite familiar with R and python, so I could use any of these.

I want a map of mexico but want to color the states according to a certain variable that goes from 0 to 100. So it would be like a heatmap of Mexico.

How can I do this?

I just have the names of the states and the corresponding value. I would therefore need an already made "empty" map with the states already defined or something.

7
  • 3
    You just need to look up an introduction to producing choropleth maps in QGIS (this will basically be the first lesson in using the software for any general tutorial). There are also plenty of tutorials floating around to make such maps in R as well. For examples of Mexico choropleth maps in R I would suggest Diego Valle Jone's blog.
    – Andy W
    Commented Sep 27, 2012 at 23:09
  • What is the source of your data? Shapefiles? Database?
    – user173
    Commented Sep 27, 2012 at 23:09
  • 1
    If you are familiar with R you could give ggplot2's geom_map a shoot. Well documented so you should bet you up and running. For more details - dive into the book.
    – user173
    Commented Sep 27, 2012 at 23:14
  • 1
    Or you could read the R Spatial Task View (google it) and then you can do maps like this with base graphics, using the sp and rgdal packages. You then use standard spatial data files for your map outlines (shapefiles, most likely) which you can download from a number of places.
    – Spacedman
    Commented Sep 28, 2012 at 7:19
  • 1
    @JEquihua - the 'mapdata' package also has a range of maps showing country and regional level boundaries which is a good starting point for mapping in R.
    – Simbamangu
    Commented Sep 28, 2012 at 9:57

1 Answer 1

8

If your data consists of points and you would like to create a heatmap, QGIS has a handy heatmap plugin. There is a great tutorial on creating heatmaps from point data here.

Often it is useful to display categorical data in your maps. In this case, I would recommend using the integrated QGIS ColorBrewer located in the style manager. There is a great tutorial here. Or, you can use the online Color Brewer for cartographic color advice.

Since your data consists of a value for each Mexican state, try the following steps:

  1. Download a .shp of Mexican states--I found one titled "Mexico States" or Global Administrative Areas
  2. Right-click the new layer and select "Toggle Editing"
  3. Right click on the layer and select "Open Attribute Table"
  4. On the bottom of the attribute table, select "New Column" and choose the necessary parameters
  5. Type in whatever value you want in the new column next to each state name
  6. Deselect the "Toggle Editing" tab
  7. Right click on the layer again choose Properties > Style
  8. Within the Style tab, choose "Categorized" and column "YourNewField"
  9. Choose the color ramp (Here you can integrate ColorBrewer)
  10. Select the "Classify" tab and the color ramp will display
  11. Select "OK"

Your new map reflects custom values associated with each state. This is only one of many ways to accomplish your goals. Good luck!

enter image description here

enter image description here

5
  • wow the tutorial was really informative!
    – nickves
    Commented Sep 28, 2012 at 1:15
  • If my data doesn't consist of points? I only have names of states associated with a certain variable. Is there an easy way to create a certain structure to color? a shp file with polygons being states? I'm being really useless I know... sorry...
    – JEquihua
    Commented Sep 28, 2012 at 2:39
  • Post edited to address comments @JEquihua
    – Aaron
    Commented Sep 28, 2012 at 3:19
  • This is amazing, thank you. Is there anyway to create a legend stating the meaning of the intensity of colors? Thank you so much...
    – JEquihua
    Commented Sep 28, 2012 at 4:04
  • Check the symbolgy tab. There you can edit the class labels. They will also be displayed (not ediable) in the layer list on the left of the map window.
    – underdark
    Commented Sep 28, 2012 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.