6.9.2 Importing and Graphing with Shapefile Data


Video Image.png Video Text Image.png Website blog icon circle.png Blog Image 33x33px.png

Summary

In this tutorial, you will be presented with the basic steps required to import a shapefile and apply a colormap to the boundaries within the file using third party data.

Shapefile finished.png

What will you learn

You will learn how to use the Import Shapefile and Colormap for Map Data apps to create a map-based graph from shapefile data.

Steps

Prior to starting this tutorial please:

  1. Install the Import Shapefile app from App Center.
  2. Install the Colormap for Map Data app from App Center.
  3. Download the shape file to be imported (decompress the folder containing the relevant files to a location of your choosing such as your Desktop).

Step One- Importing the Data

From the App Gallery docked on right side of Origin workspace, click on the Import Shapefile app icon. Then, select the *.SHP file you just downloaded. Be sure that Output Data Points is checked (see below) and click OK.

Shapefile dlg.png

You will now have a workbook with data and a graph (see below). For this tutorial, you can delete the graph- another one will be made later.

Shapefile imported.png

Step Two- Making the Data Useful

With the worksheet containing the shapefile data active, click on the Colormap for Map Data app icon in App Gallery. A small toolbar with two buttons will appear. Click the first button Reorder Shapefile Data. In the dialog that opens, Click > button next to Names for ID and choose J(Y): NAME (see below). Click OK.

Shapefile colormap dlg.png

A new output sheet entitled Shapefile Data Reordered is created and activated. Observe the Value column which is currently blank (see below).

Shapefile reordered.png

Paste the following poverty rate data1 into that column.

16.8
10.9
14
17.2
12.8
9.6
10.4
12.5
16.2
13.6
14.3
8.8
11.8
12.1
13.1
11.2
12
16.9
18.6
11.6
9
10
14.1
9.6
19.7
13.2
13
11
12.9
7.6
9.5
19.5
13.6
14
10.7
13.9
15.6
12.6
12.2
43.1
12.9
15.3
13.1
15.3
14.9
9
11
10.7
10.3
17.8
11
11.1

1 Source: List of U.S. states and territories by poverty rate

In the Colormap for Map Data toolbar, click the 2nd button Create Colormap Map Plot. You will see a new graph. Change the Horizontal axis scales From and To to -175 and -60 respectively. Then, change the Vertical axis scales From and To to 17 and 72 respectively (see below).

Shapefile beforeafter.png

The graph is now in a state to be customized (see below).

Shapefile rough.png

Customizing the Graph

Among the many customizations that will lead to the finished graph displayed at the top of this tutorial, here are a few important ones you may pursue on your own:

  1. Hide the axes lines, ticks, labels, and titles.
  2. From the Graph menu, select Fit Page to Layer... dialog to adjust the graph size.
  3. Adjust colormap levels for the plot.
  4. Adjust color scale settings.
  5. Adjust individual label positions.

Lastly, you will observe that the Alaska, Hawaii, and Puerto Rico have been moved. This step essentially involves making copies of the main graph layer and pasting them back into the main layer while adjusting the axes scale From and To values for each pasted layer (state). Then the layers are resized and moved into place.