6.9.2 Importing and Graphing with Shapefile Data
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.
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.
Prior to starting this tutorial please:
- Install the Import Shapefile app from App Center.
- Install the Colormap for Map Data app from App Center.
- 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.
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.
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.
A new output sheet entitled Shapefile Data Reordered is created and activated. Observe the Value column which is currently blank (see below).
Paste the following poverty rate data1 into that column.
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).
The graph is now in a state to be customized (see below).
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:
- Hide the axes lines, ticks, labels, and titles.
- From the Graph menu, select Fit Page to Layer... dialog to adjust the graph size.
- Adjust colormap levels for the plot.
- Adjust color scale settings.
- 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.