CARTO User Manual

CARTO User Manual

Go back

Build a categories & bubbles visualization

Context

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. 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.

    Log in Email and password

  2. From the Navigation Menu in the left panel, select Data Explorer.

    Menu features data explorer

  3. Select the CARTO Data Warehouse connection and click on demo data > demo_tables from the collapsible tree.

    Data Explorer content carto data warehouse

  4. Selected “populated_places” and explore the preview of the map and the details of the table.

    Data Explorer map prewiew

    Data Explorer data prewiew

  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.

    Data Explorer create map from table

  6. Change layer name to “Populated Places”.

    Map layers rename

  7. Click on Layer style to start styling the layer.

    Map layers options

  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).

    Map fill style based on field

  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.

    Map style radius additional features

  10. Go to Widget tab. If you haven’t created a widget yet, you will see the following page:

    Map widgets new widget

  11. Click on New widget button and select “populated_places”.

    Map widgets select source

    When you add a widget, it´s always the Formula widget by default:

    Map widgets formula by default

  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.

    Map category widget selected column

  13. Select “United States of America” from the list to highlight this particular category and temporally remove the others from your visualization:

    Map category widget selected element

  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.

    Map histogram widget selected field

  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.

    Map widgets rename

  16. You can also change the format as the values are displayed and add some notes to your widget.

    Map histogram widget note

  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.

    Map tooltips new tooltip

  18. Finally we can change our basemap. Go to Basemaps tab and select “Dark matter” from CARTO.

    Map basemap carto

  19. Rename the map to “Populated Places”.

    Map rename title

  20. We can make the map public and share it online with our colleagues. For more details, see Publishing and sharing maps.

    Map public map

  21. Finally, we can visualize the result.