
Smart Mapping: Compare A to B
Compare two numbers as a percent or ratio of one to the other
Get Started with the Compare A to B style
When mapping two attributes, you often want to compare two attributes as a ratio. How do you map a percent or ratio if you don’t have that as an attribute field in your data? Well, if you have the numerator and denominator somewhere in your data, you can use the Compare A to B smart mapping style .
When working with your data in ArcGIS Online and ArcGIS Enterprise, choose the Styles option to work with smart mapping .
Smart mapping helps you create beautiful and informative maps, quickly. It sets the cartography of your layer based on the significant values within your data. Smart mapping lets anyone quickly discover patterns from attributes in their data and make meaningful maps from them.
The Compare A to B style allows you to compare two numbers and express their relationship as a percentage or simple ratios. There are three patterns available with the Compare A to B style:
- A as a percent of B (A/B*100) where A is a count and a part of the total count B
- A as a percent of A+B (A/(A+B) * 100) where A and B are their own counts, e.g. owners and renters
- A as a ratio to B (A/B)
This style works well when there are only two groups of interest, such as men and women, owners and renters, veterans and non-veterans, or the same count for two different points in time. For example , you can map the projected population for 2025 as a percentage of the known population in 2015 to observe the trend of population shift.
Areas with higher population growth are in purple
Areas with lower population growth are in orange
This map style works with numeric attributes such as counts or percents. Compare A to B can be used for points, lines, polygons. Let's walk through a few steps to create a Compare A to B style map.
Global Population Change - Compare A to B Example
Create a map using Compare A to B style
It's always a good idea to choose a basemap that gives an appropriate amount of detail, while also having neutral colors that allows your data to be the highlight on your map.
In this case, the Human Geography map from Living Atlas is selected that shows an adequate amount of geographic information, such as roads and geographic names, but its light gray colors allow for our data to be the main focus.
Note: If you do not see the Human Geography basemap available under your Basemaps pane, scroll down and click on the Living Atlas magnify glass, and search for 'Human geography map.'
With your layer of interest selected, open the Styles pane on the right hand side.
Here you have two attributes of interest selected, Renter-Occupied Housing Units and Owner-Occupied Housing Units.
Smart mapping recognizes that you have chosen two numeric attributes, and suggests a map style as a starting point. Let’s choose the Compare A to B style instead.
Smart mapping only gives us diverging color ramps (aka Above and Below theme) when using the Compare A to B style, which are perfect for mapping above and below a meaningful value or an average.
Changing the symbol style's default color ramp to a color ramp more suited to highlighting the ratio of renter-occupied housing units to owner-occupied housing units.
Smart mapping makes it super-easy to try out color ramps to find the one that tells your data’s story best. You can filter for color ramps that work best for light basemaps, such as this blue-gray color ramp.
This color ramp helps emphasize in blue where there are more renter-occupied housing units in comparison to owner-occupied housing units.
You can change how the legend is read by changing the Labels.
Show the ratio of A to B shows the ratio of renter-occupied housing units compared to owner-occupied housing units.
Show A as a percent of A and B shows renter-occupied housing units as a percent of the sum of renter + owner occupied housing units.
This works well if your two attributes sum up to the total possible, or to a total you’d like to focus on. In this example, the U.S. Census Bureau provides data on 1) owner-occupied, 2) renter-occupied, and 3) vacant housing. Choosing to map only owner and renter occupied housing is a valid choice, but is not a substitute for mapping against a known Total Housing count.
Show A as a percent of B shows renter-occupied housing units as a percent of owner-occupied housing units.
This label style works well for comparing over time, such as in our example in the beginning comparing population projections to a historical population number.
By default, your color ramp will be centered on the Average Value. The map reflects the variation around the mean or average of the data. This is a good option for when you do not expect the A and B attributes to be equal.
If you expect the two attributes you are mapping to be, generally speaking, equal, you can adjust the map to reflect that expectation. Switching the "Center at" to Equal Values will center your color ramp around a 1:1 ratio, which is useful for when you want to efficiently show a 1:1 comparison. In this example, for every one renter-occupied housing unit, there is one owner-occupied housing unit.
Using Swipe on the images on the right, you can reveal how both centering options change our color ramp. Move the swipe slider to the left to see more emphasis of areas that are closer to a 1:1 ratio. Move the swipe slider to the right to emphasize areas centered around the average/mean value.
You see Average Value works best for centering our values on, as the Equal Values makes almost all our areas gray, not a very fun map!
Dragging the vertical bars up or down will preserve your top and bottom breakpoints spacing, while changing what color is assigned to a given value.
Individually adjusting the handles emphasizes/deemphasizes different parts of your color ramp.
Create your own
In just a few quick steps, you were able to map the comparison between two attributes using the Compare A to B smart mapping style.
The Compare A to B style allows you to easily map the ratio between two numbers and express that relationship as percentages, simple ratios, or overall percentage. With smart mapping doing the heavy lifting by taking the guesswork out of setting your map properties, you'll be able to quickly explore new patterns and explore your data deeper.
Customize the styles to create a map the best suits your needs, and share your maps with the hashtag #smartmapping and #ArcGISOnline.