# Data Science: An Introduction/Thinking Like a Visual Artist

Data Science: An Introduction
* Welcome to Data Science
** 01: A History of Data Science
** 02: A Mash-up of Disciplines
** 03: Definitions of Data
** 04: The Impact of Data Science
* Thinking about the World
** 05: Thinking Like a Visual Artist
** 06: Thinking Like a Data Engineer (Oct 13, 2012)
** 07: Thinking Like a Hacker
** 08: Thinking Like a Programmer
** 09: Thinking Like a Scientist
** 10: Thinking Like a Mathematician
** 11: Thinking Like a Statistician
** 12: Thinking Like a Domain Expert
* Analyzing and Visualizing, Part One
** 13: Single Variable Analysis
** 14: Single Variable Tables and Plots
* Setting up the Problem
** 15: Theory-Based Inquiry
** 16: Theoretical vs Measured Variables
** 17: Hypothesis Testing
* Collecting, Ingesting, Transforming Data
** 18: Collecting vs Finding Data
** 19: Data Dictionaries and Schemas
** 20: Data Preparation and Metadata
* Analyzing and Visualizing, Part Two
** Scientific data visualisation
** 21: Two Variable Analysis
** 22: Two Variable Tables
** 23: Two Variable Plots
* Emergent Answers to Free Form Problems
** 24: Non-Theory-Based Inquiry
** 25: Exploratory Analysis
* Analyzing and Visualizing, Part Three
** 26: Scientific data visualisation
** 26: Multiple Variable Analysis
** 27: Multiple Variable Tables
** 28: Multiple Variable Plots
* Presenting Results
** 29: Statistical Significance vs Substantive Significance
** 30: Telling the Story
** 31: Writing Good Data-Rich Paragraphs
** 32: Creating Good Data-Rich Slides
* Appendices
** 01. Glossary
** 02. Working in Groups
** 03. 250 R Commands
** 04. Research Design
** 05. Data Dictionary
Edit This Box

## Chapter Summary

Five design elements—Harmony, Rhythm, Flow, Balance, and Focus—are essential considerations to think like a visual artist. A data scientist must think creatively to combine these elements together in appropriate proportions to convey the essential conclusions to the audience.

## Discussion

There are a dozen or more "Rules of Thumb" to guide the data scientist to think like a visual artist. We will examine just a few.

#### Harmony

The Wiktionary defines Harmony as a pleasing combination of elements. In visual art, harmony is the concordant use of shape and color. Humans easily consume and thus are attracted to harmonious visualizations. A data scientist will want to make sure the visual representations of the solution blend together well. One aspect of harmony is to consistently use a coherent color scheme across an entire presentation. One popular set of color schemes is to take 3 or 4 adjacent colors from the color wheel, such as the "earth" tones on the upper right or the "cool" tones on the upper left. A "complementary" color scheme will take colors from opposite sides of the color wheel.
Similarly, when building a series of charts and graphs, the data scientist will want to have a consistent layout across them all, including using the same symbols and typefaces.

#### Rhythm

The Wikipedia defines Rhythm as a pattern marked by the regulated succession of strong and weak elements, or of opposite or different conditions across time and/or space. When a data scientist discovers rhythms in the data, she must then consider how to communicate these visually. A sine wave shows a consistent rhythm over time.
One useful device is to show deviations (blue line) in the data from the background rhythm (black line), such as this chart showing climate change over the last 550 million of years.
Another example is a depiction of the simulation of two waves interfering with each other.
A final example shows the correlated distributions between two variables. Because the highs and lows are off center but repeat symmetrically, the correlations are not linear, but regular and offset by a constant amount.

#### Flow

The Wiktionary defines Flow as the movement of a fluid. In visual art, flow is the illusion of movement through the manipulation of color and form. The human eye will naturally follow visual cues in the image. A data scientist will want to make sure the visual representations of the solution tell a "story" by inviting the eye to move from start to finish. Peter Paul Rubens was a baroque Dutch painter that perfected artistic flow. In his painting, "Fall of Phaeton," one cannot but help move the eye toward the upper right.
So it is with data scientists. Their analysis of the data leads to come conclusion. The trick to is to depict the that helps lead the recipient to the conclusion. Sometimes flow is an inherent component of the data, such as the depiction of a fluid moving around a solid, with the resulting turbulence.
Many times, the data represent concepts that are inter-related and those relationships are shown as a flow diagram, such as this one from the July 1987 Psychological Review.

#### Balance: Symmetry

Balance is an important visual cue. The simplest form of balance is symmetry. The Wikipedia defines Symmetry as self similarity across time, space, or scale. Human beings find symmetry comforting. Many living things show symmetry in space such as a butterfly.
Humans also create objects with symmetry, such as buildings, like the Taj Mahal.
A data scientist will play to the human preferences for symmetry in visually presenting the solutions to problems. In the following example, the four graphs show size symmetry—and three of them show scale symmetry. They are also placed so as to be both horizontally and vertically symmetric. This multiple symmetry aids in the understanding of the information being presented.

#### Balance: Rule of Thirds

While symmetrical balance can help an audience to feel comfortable with data presentations, asymmetrical balance is often more visually appealing. We are not talking about just any random asymmetry, but two particular asymmetries. The first one we will exam is the Rule of Thirds and the second is the Golden Ratio. According to the Wikipedia, the "Rule of Thirds" proposes that an image should be imagined as divided into nine equal parts by two equally-spaced horizontal lines and two equally-spaced vertical lines, and that important compositional elements should be placed along these lines or their intersections. Proponents of the technique claim that aligning a subject with these points creates more tension, energy and interest in the composition than simply centering the subject would.
In the example below, the picture has been cropped without and with the rule of thirds. The right hand picture has the mountain tops along the axis of the bottom third, the stone outcropping is positioned along the axis of the left third, and the clouds hover just above the top third.
Thinking like a visual artist means thinking of visualizing data in terms of the "rule of thirds." For example, the chart below takes advantage of the rule of thirds, by placing the horizontal rules in thirds, and added the comment on the upper horizontal rule at about the position of the (imagined) right-most rule.

#### Balance: Golden Ratio

Although somewhat similar to the Rule of Thirds, the Golden ratio is a much more well developed concept, both in mathematical theory and in application to real world problems. According to the Wikipedia, the "Golden Ratio" is defined as two quantities where the ratio of the sum of the quantities to the larger quantity is equal to the ratio of the larger quantity to the smaller one. The figures below illustrate the relationship.
and
The golden ratio is expressed algebraically as:
       ${\frac {a+b}{a}}={\frac {a}{b}}\equiv \varphi ,$
where the Greek letter "Phi" ($\varphi$) represents the golden ratio. Its value is:
       $\varphi ={\frac {1+{\sqrt {5}}}{2}}=1.61803\,39887\ldots .$
Many artists and architects have proportioned their works to approximate the golden ratio—especially in the form of the golden rectangle, in which the ratio of the longer side to the shorter is the golden ratio—believing this proportion to be aesthetically pleasing. A golden rectangle can be cut into a square and a smaller rectangle with the same aspect ratio. Mathematicians since Euclid have studied the golden ratio because of its unique and interesting properties. The golden ratio is also used in the analysis of financial markets, in strategies such as Fibonacci retracement. The golden ratio is commonly used in everyday design, for example in the shapes of postcards, playing cards, posters, wide-screen televisions, photographs, and light switch plates. Studies by psychologists have been devised to test the idea that the golden ratio plays a role in human perception of beauty, such as female waist to hip ratio, male shoulder to hip ratios, and forehead to face ratios. While some early studies showed support for this hypothesis, later attempts to carefully test the hypothesis have been inconclusive.
* One classic example of the application of the golden ratio is the Great Mosque of Kairouan, built in 670 AD in Tunisia. The golden ratio is repeated from the overall design to the individual rooms and columns. Not only is it one of the oldest places of worship in the Islamic world, is one of the most impressive and largest Islamic monuments in North Africa. The mosque is a masterpiece of both architecture and Islamic art.
* Another example is Salvador Dalí's The Sacrament of the Last Supper. The dimensions of the canvas are a golden rectangle. A huge dodecahedron, in perspective so that edges appear in golden ratio to one another, is suspended above and behind Jesus and dominates the composition. See an image of the painting at the National Gallery of Art.
As a data scientist develops more sophisticated analytical skills, she will also need to develop more sophisticated visual presentation skills. The Golden Ratio is one way to put analytical and visual sophistication in harmony with each other. One simple way is to divide up the presentation charts in sections like example below:

#### Focus

The Wiktionary defines Focus as the concentration of attention. The data scientist will want to create visualizations to draw the audience's attention to the important point. Visual artists create focus by contrasting size (scale), color, and page position. It is important to make sure the visual elements have a function that supports the content. For example, in Francisco de Goya's painting, "The Vintage," he wants to highlight the grape harvest. First, he uses a triangular positioning of the people so that the grapes are at the apex of the triangle. He also places the grapes in the center of a bright (triangular) cloud that is surrounded by a dark cloud. He masterfully uses both design and color to bring focus to the subject of his painting.
Here is a good use of focus to highlight conclusions based on data. The following charts depict above and below average country GDP per capita from the World Factbook and malaria risk by country from the Centers for Disease Control.

#### Creativity

The data scientist must use creativity to combine these five elements (Harmony, Rhythm, Flow, Balance, and Focus) together in appropriate proportions to convey the messages in interesting and informative ways to the audience. The creative process includes divergent thinking, which involves the generation of multiple answers to a problem; conceptual blending, in which solutions arise from the intersection of two quite different frames of reference; and, honing, in which an acceptable solution emerges from iterating over many successive unacceptable versions of the solution. In practice, creativity is often a team sport. When several people from diverse backgrounds come together to solve a problem, they can more easily engage in divergent thinking and conceptual blending. Honing is just good, old-fashioned elbow grease. Please do not fall in love with your first attempt. Think of your first attempt as the beginning (not the end) of a conversation that will engage both members of the data science team, as well as members of the potential audience for the team's findings.
The following graph is a good example of a science graphic using all five visual elements. See if you can see how harmony, rhythm, flow, balance, an focus are used.
   * The image shows that the atoms in a molecule can be modeled as charged spheres connected by springs that maintain bond lengths and angles. The charged atoms interact with each other (via Coulomb's law) and with solvent. The shroud represents the region of hydrophobic repulsion, where the strength of the hydrophobic effect is approximately proportional to the surface area of the shroud. The shroud, shown extending only over the back of the molecule actually extends all the way around it. The model shown is called a molecular mechanics potential energy function, and it is used by programs like Folding@Home to simulate how molecules move and behave. The molecule shown is an alanine dipeptide.

## Assignment/Exercise

Use R to create some tables and plots. Get into groups of 2 to 3 students. Try to work with at least one other person you have not been a group with before. Be sure everyone in your group understands all of the R code as you execute it. Let's start by examining a categorical variable.
Let's try exploring a continuous variable.
Now try this simple plot.
You will need to add the library "calibrate" to your R workspace in order to use the "textxy" command in the following example. Use the "package manager" and "package installer" commands from the R console pull down menus. The packages chapter in the R programming Wikibook is a place to start.
Now, let's replace that first plot command with the following.
Be sure to print out a copy of that plot to use for reference.
Now, let's try changing the colors.
And, now let's change the size of the points in the plot
Finally, let's draw a line through the points.

## More Reading

* Livio, Mario (2003). The Golden Ratio: The Story of PHI, the World's Most Astonishing Number. New York: Broadway. ISBN 978-0767908160.
* Hans Rosling (2006). "Stats that reshape your world-view". Video. TED. Retrieved 15 August 2012.
* Tufte, Edward (2001) [1983]. The Visual Display of Quantitative Information (2nd ed.). Columbia, MD: Graphics Press. ISBN 978-0961392147.
* "Tableau Visual Guidebook". White Paper. Tableau Software. Retrieved 19 November 2012.

## References

* ↑ See, for example, Douglas Kipperman and Melissa McKinstry (2008). "Design Rules of Thumb". WriteDesignOnline. Retrieved 15 August 2012.
* ↑ Higgins, E. Tory (1987). "Self-discrepancy: A theory relating self and affect". Psychological Review. 94 (3): 319–340. Retrieved 25 August 2012. {{cite journal}}: Unknown parameter |month= ignored (help)
* ↑ Salvador Dali (1955). "Sacrament of the Last Supper" (PDF). Painting. National Gallery of Art. Retrieved 15 August 2012.

## Copyright Notice

You are free:
* to Share — to copy, distribute, display, and perform the work (pages from this wiki)
* to Remix — to adapt or make derivative works
Under the following conditions:
* Attribution — You must attribute this work to Wikibooks. You may not suggest that Wikibooks, in any way, endorses you or your use of this work.
* Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
* Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
* Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
* Other Rights — In no way are any of the following rights affected by the license:
   * Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
   * The author's moral rights;
   * Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
* Notice — For any reuse or distribution, you must make clear to others the license terms of this work.The best way to do this is with a link to the following web page.
       http://creativecommons.org/licenses/by-nc-sa/3.0/