Find Background Image Coordinates

In many scenarios, you might want to map your data onto a background image instead of on a Tableau map. This article explains how to plot data points on a background image.

There are several steps to this process:

  1. Create a table in your data source for X and Y coordinates.

  2. Connect to your data source in Tableau Desktop and join the coordinate table with the rest of your data.

  3. Import your background image and build the view.

  4. Annotate points on the background image.

  5. Add coordinates to the coordinates table in your data source.

  6. Refresh your data source in Tableau.

Step 1: Create the coordinate table

Create a table in your data source that contains columns to identify a unique mark. In this example, there are three columns:

  • The first column holds the unique identifier for each mark.

  • The other two columns are for the X and Y coordinates.

After you create your columns, you join the new coordinate table to the original data source. The join is based on the unique identifier used in both the original data source and the coordinate table (the identifier that represents a single mark).

  1. Select a scale that is appropriate for your background image. If the image is wider than it is tall, use X: 0-100 and Y: 0-50.

  2. For this example, open the Sample Superstore Excel file from your Tableau repository in Excel and select a new sheet tab.

  3. On the new tab, put a single row in a table that contains one of the unique identifiers and the X and Y end points you selected for your two scales.

    In this case, Product Sub-category is a column in Sample Superstore, and one of its members is Tables. The X endpoint is 100, and the Y endpoint is 50 because that is the scale for the background image.

  4. Change the tab name to Coords and save the file.

Step 2: Connect to the coordinate table

  1. In a new Tableau workbook, select Connect to Data.

  2. In the Connect to Data dialog box, select Microsoft Excel and then click Next.

  3. On the data source page, do the following:

    • Drag the Orders sheet to the Join area.

    • Drag the Coords sheet to the Join area.

    • Click the join icon to modify the existing join.

    • In the Join dialog box that opens, select Left, and then select Product Sub-Category for the Data Sourcecolumn, and Product Name (Coords) for the Coords column.

  4. Close the Join dialog box, and then select the sheet tab to go to a worksheet.

Step 3: Import the background image

  1. In the new worksheet, select Maps > Background Images, Sample - Superstore. This opens the Background Images dialog box.

  2. In the Background Images dialog box, click Add Image.

  3. In the Add Background Image dialog box, browse to and select the file.

  4. For X Field, select X in the list.

    Note: If you do not see the X field in the list, it means that you need to change the X field to be a continuous number.

    To change the field to be a number, right-click the X field in the Data pane, and select Change Data Type > Number (Whole). To convert the field to be continuous, right-click the X field in the Data pane, and select Convert to Continuous.

    Repeat these steps for the Y field.

  5. In the Right text box, type 100 (100 is the number you used in the coordinate table).

  6. For Y Field, select Y in the list.

  7. In the Top text box, type 50 (50 is the number you used in the coordinate table). Be sure to type in the correct text box.

  8. Click OK, and then click OK in the Background Images dialog box. (Disregard the Valid setting of No in the Background Images dialog box.)

Step 4: Find the coordinates

  1. From the Data pane, drag X to the Columns shelf and Y to the Rows shelf.

  2. On the Columns shelf, right-click X and select Dimension.

  3. On the Rows shelf, right-click Y and select Dimension.

    Note: This step is only necessary if the X and Y fields were brought in to Tableau as Measures.

    The background image appears in the view.

  4. Right-click the X axis and select Edit Axis.

  5. In the Edit Axis dialog box, select Fixed, and then in the Start text box, type 0, and in the End text box, type 100.

  6. Click OK.

  7. Right-click the Y axis and select Edit Axis.

  8. In the Edit Axis dialog box, select Fixed, and then in the Start text box, type 0, and in the End text box, type 50.

  9. Click OK.

    Now the axes start at zero.

  10. Right-click anywhere on the image where you want to find the coordinates, and select Annotate > Point.

    For more information about annotating marks or points in the view, see the Add Annotations(Link opens in a new window) topic in the Tableau Help.

  11. In the Edit Annotation dialog box, click OK.

  12. Repeat steps 10 and 11 for each point you want to annotate.

    The coordinates appear on the background image as a callout. You can move a callout to a location where it shows up better; just click and drag it. You can also resize the callout by dragging one of the size handles. You can move a coordinate point to a new location by clicking and dragging the arrowhead; the coordinates in the callout change to reflect the new location.

  13. Add these coordinates to the Coords sheet in the Sample - Superstore Excel file and save the changes.

  14. In Tableau, select Data > Sample - Superstore > Refresh.

    The refreshed view displays marks at the coordinate locations.

    If you don't want to continue to display the callouts, you can select and remove them on the background image.

Other Ideas

Try placing another Measure on the Size shelf and put either a Dimension or Measure on Color on the Marks card. Add your own custom shapes. Develop powerful and unique analyses by creating Actions between this view and your other analyses.

If you want to hide the X and Y scales, right-click the respective field on the Columns or Rows shelf and clear Show Header.

See also

Thanks for your feedback! There was an error submitting your feedback. Please try again.