Tableau: Visualize Maps

Author

David Gerbing

Published

May 14, 2024, 10:02 pm

This document is the Tableau implementation of the more general, conceptual discussion regarding maps.

Symbol Map: Largest Italian Cities

We use the simplemaps.com free data base of almost 48,000 cities.

  1. Download and prepare the data file, worldcities.xlsx. Delete the city column with its non-ASCII characters.
  2. Read the data into Tableau.
  3. Tableau does not recognize the abbreviation Lng for Longitude, so select and choose Geographic Role, then Longitude.
  4. Use the Longitude and Latitude provided by the data file, not that generated by Tableau as it cannot probably classify thousands of the provided cities. Drag Lat to the Rows shelf and Lng to the Columns shelf.
  5. Drag the country variable to the Filters card and select Italy.
  6. Go to the main menu select Analysis and then click on Aggregate Measures, which will disaggregate.
  7. Drag the population variable over to the Filters card and indicate a minimum value of 250,000.
  8. Create a bubble chart by dragging the population variable over to the Size mark
  9. Options:
    • change the color of the plotted bubbles: Click on the Color mark
    • enhance the tooltips when hovering the mouse over a city: Drag the city over the Tooltip mark
    • change the background map: Map menu, choose Background Maps, then Satellite
  10. Add labels to the bars [optional]: Select the numerical variable and drag to the Label mark.
    • Tableau will again default aggregate to Sum for the labels even if the aggregation on the bar chart y-axis is AVG.
    • Usually change that aggregation for the labels to be the same aggregation on the y-axis for consistency.

The link to the video of examples of these processes follows.

Video: Larger Italian Cities. [6:44]

Choropleth Map: Gini Index USA States

If you wish to follow along with the video, find the data file at:

  web.pdx.edu/~gerbing/0Viz/Maps/data/Gini2021byState.xlsx

  1. Read the Excel data file containing the State names and the Gini coefficients into Tableau.
  2. Assign the State variable, ID, as a geographic object. Right-click the ID variable in the data pane, then choose Geographic Role -> State/Province.
  3. Create the map.
    • drag the ID field to the Rows shelf
    • drag the Gini variable to the Color mark
    • go to the Show Me palette and click on the filled map icon: Second row. middle column
  4. Hold the Shift key and drag the map to focus on the main body of the USA
  5. Option: Choose a different color palette from the Color mark

The link to the video of examples of these processes follows.

Video: Choropleth map of the United States. [3:39]

City Map: Portland with Custom Geocodes

If you wish to follow along with the video, find the data file at:

  web.pdx.edu/~gerbing/0Viz/Maps/data/PDXgeocodes.xlsx

  1. Prepare the Excel data file with the location name, address, and any additional information.
  2. Read the data file into R.
  3. Check to make sure that the longitude and latitude variables are recognized as geographical information, geocodes.
  4. Drag the latitude variable to the Rows shelf and the longitudinal variable to the Columns shelf.
  5. Go to the main menu select Analysis and then click on Aggregate Measures, which will disaggregate the plotted values.
  6. Go to the main menu, select Maps, then Background Maps, then Streets.
  7. To create a bubble plot, drag a numerical variable such as Profit over to the Size mark

The link to the video of examples of these processes follows.

Video: Map of Portland Locations. [3:43]