Basic scatter
CDP Data Visualization, enables you to create a basic Scatter visual.
The following steps demonstrate how to create a new scatter visual representation, showing the trend of life-expectancy and GDP per capita for selected countries.
- Start a new visual based on dataset
World Life Expectancy
[data sourcesamples.world_life_expectancy
]; see Creating a visual. - In the visuals menu, find and click Scatter Plot.
- Note that the shelves of the visual changed. They are now X,
Y, Colors, Size,
Transition, Tooltips, and
Filters.
The mandatory shelves for scatter visuals are X and Y, representing the X-axis and Y-axis. Note also that the fields placed on these two shelves may be easily swapped by switching X and Y.
- Populate the shelves from the available fields (Dimensions,
Measures, and so on) in the Data menu.
-
Under Measures, select
gdp_per_capita
and drag it over the X shelf on the main part of the screen. Drop to add it to the shelf. -
Under Measures, select
life_expectancy
and drag it over the Y shelf on the main part of the screen. Drop to add it to the shelf.
-
Under Measures, select
- In both cases, remove the aggregate to see individual data points.
-
On the shelf, on
sum(gdp_per_capita)
field, click the (right arrow) icon, expand the Aggregates menu, and click on the check mark next to the Sum option to remove the aggregate. -
Note that the shelf now contains the modified field
gdp_per_capita
.
-
- Click Refresh Visual.
The scatter graph appears.
- Notice that while we can see the general shape of data and a few outliers, there is too little distinguishing information to help us understand the trends.
- Let us use the Colors shelf to see if a pattern emerges.
Under Dimensions, select
country
and drag it over the Colors shelf on the main part of the screen. Drop to add it to the shelf. - Again, click Refresh Visual, and examine the resulting graph.
- Notice that we can now see the trend for some of the countries very clearly, over time. The
visualization is less than ideal, yet obvious details emerge:
- Zimbabwe, in gray, shows an appreciable increase in life expectancy, but relative to other countries, very little economic improvement (measured as GDP per capita).
- United States, in purple, shows the expected improvement in both longevity and in GDP.
- Kuwait, in light green, is a true outlier that shows phenomenal increase in GDP per capita, but suffers a noticeable decrease in life expectancy from about the mid-century to present day.
- Add aggregation back onto the measures on the X and Y shelves. This time, we want to see the
average of the dimensions.
-
On the X shelf, on
gdp_per_capita
field, click the (down arrow) icon, select Aggregates, and then select Average. -
On the Y shelf, on
life_expectancy
field, click the (down arrow) icon, select Aggregates, and then select Average.
-
On the X shelf, on
- [Optional] Turn on the Changing legend style and removing the legend feature.
- Click Refresh Visual.
The scatter graph appears.
- Note that the distribution is an average of ALL years covered by the dataset, from 1990
through 2010. Still, some outliers are already clearly visible: Qatar and Kuwait for
exceptionally high GDP per capita, Tokelau for high life expectancy at very low GDP per
capita, and Sierra Leone, with the lowest life expectancy in the world.
Figure 1. Contrasting Average Life Expectancy and GDP Per Capita, World-Wide - Click (pencil icon) next to the title of the visualization to edit it, and enter the new name.
- Change the title to World Population - Scatter.
-
At the top left corner of the Visual Designer, click
Save.
It is useful to remember at this point that GDP per capita is actually influenced by the population of the country.
Let us next look at how we can show the population variation on this graph, by Adding size to a scatter visual.