Ask or search…
Comment on page

Build a categories & bubbles visualization


Understanding population distribution has important implications in a wide range of geospatial analysis such as human exposure to hazards and climate change or improving geomarketing and site selection strategies.
In this tutorial we are going to represent the distribution of the most populated places by applying colours to each type of place and a point size based on the maximum population. Therefore, we can easily understand how the human settlement areas is distributed with a simple visualization that we can use in further analysis.

Steps To Reproduce

  1. 1.
    Go to the CARTO signup page.
    • Click on Log in.
    • Enter your email address and password. You can also log in with your existing Google account by clicking Continue with Google.
    • Once you have entered your credentials: click Continue.
  2. 2.
    From the Navigation Menu in the left panel, select Data Explorer.
  3. 3.
    Select the CARTO Data Warehouse connection and click on demo data > demo_tables from the collapsible tree.
  4. 4.
    Selected “populated_places” and explore the preview of the map and the details of the table.
  5. 5.
    Create a map by clicking on the Create map button on the top. This will open the table as a layer on a CARTO Builder map. Check Creating a map from your data to get started.
  6. 6.
    Change layer name to “Populated Places”.
  7. 7.
    Click on Layer style to start styling the layer.
  8. 8.
    Click on the “three dots” icon in the Fill Color section and select “Color Based On” feature featurecla. It has information about what kind of places there are. Pick a palette for a categorical variable (versus a gradient).
  9. 9.
    Now click on the options for the Radius configuration and in the section “Radius Based On” pick the column pop_max. Play with the minimum/maximum size to style the layer as you like.
  10. 10.
    Go to Widget tab. If you haven’t created a widget yet, you will see the following page:
  11. 11.
    Click on New widget button and select “populated_places”.
    When you add a widget, it´s always the Formula widget by default:
  12. 12.
    Select CATEGORY widget, choose COUNT operation from the list and select the column admin0name. Now we can filter the data based on the country.
  13. 13.
    Select “United States of America” from the list to highlight this particular category and temporally remove the others from your visualization:
  14. 14.
    Click on the Back arrow and then click on Add widget to add a second widget (HISTOGRAM), now based on pop_max. You will get a histogram widget in order to be able to filter the populated places based on their population.
  15. 15.
    Change the names of both widgets for “Nº of Countries” and “Size (inhab.)”. Click on the Back arrow and then click on the “three dots” icon to configure rename your widgets.
  16. 16.
    You can also change the format as the values are displayed and add some notes to your widget.
  17. 17.
    Now let’s configure the tooltip (or info window). Go to Interactions tab, activate the tooltip and select the fields admin0name, Featurecla and Pop_max.
  18. 18.
    Finally we can change our basemap. Go to Basemaps tab and select “Dark matter” from CARTO.
  19. 19.
    Rename the map to “Populated Places”.
  20. 20.
    We can make the map public and share it online with our colleagues. For more details, see Publishing and sharing maps.
  21. 21.
    Finally, we can visualize the result.