Skip to content

Commit

Permalink
production images at 300 dpi
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Jan 15, 2019
1 parent 3968bcd commit 33a958d
Show file tree
Hide file tree
Showing 363 changed files with 607 additions and 607 deletions.
10 changes: 5 additions & 5 deletions _book_production/aesthetic-mapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ <h2><span class="header-section-number">2.1</span> Aesthetics and types of data<
<p>Aesthetics describe every aspect of a given graphical element. A few examples are provided in Figure <a href="aesthetic-mapping.html#fig:common-aesthetics">2.1</a>. A critical component of every graphical element is of course its <em>position,</em> which describes where the element is located. In standard 2d graphics, we describe positions by an <em>x</em> and <em>y</em> value, but other coordinate systems and one- or three-dimensional visualizations are possible. Next, all graphical elements have a <em>shape</em>, a <em>size</em>, and a <em>color.</em> Even if we are preparing a black-and-white drawing, graphical elements need to have a color to be visible, for example black if the background is white or white if the background is black. Finally, to the extent we are using lines to visualize data, these lines may have different widths or dash–dot patterns. Beyond the examples shown in Figure <a href="aesthetic-mapping.html#fig:common-aesthetics">2.1</a>, there are many other aesthetics we may encounter in a data visualization. For example, if we want to display text, we may have to specify font family, font face, and font size, and if graphical objects overlap, we may have to specify whether they are partially transparent.</p>

<div class="figure" style="text-align: center"><span id="fig:common-aesthetics"></span>
<img src="aesthetic_mapping_files/figure-html/common-aesthetics-1.png" alt="Commonly used aesthetics in data visualization: position, shape, size, color, line width, line type. Some of these aesthetics can represent both continuous and discrete data (position, size, line width, color) while others can only represent discrete data (shape, line type)." width="1260" />
<img src="aesthetic_mapping_files/figure-html/common-aesthetics-1.png" alt="Commonly used aesthetics in data visualization: position, shape, size, color, line width, line type. Some of these aesthetics can represent both continuous and discrete data (position, size, line width, color) while others can only represent discrete data (shape, line type)." width="630" />
<p class="caption">
Figure 2.1: Commonly used aesthetics in data visualization: position, shape, size, color, line width, line type. Some of these aesthetics can represent both continuous and discrete data (position, size, line width, color) while others can only represent discrete data (shape, line type).
</p>
Expand Down Expand Up @@ -427,23 +427,23 @@ <h2><span class="header-section-number">2.2</span> Scales map data values onto a
<p>To map data values onto aesthetics, we need to specify which data values correspond to which specific aesthetics values. For example, if our graphic has an <em>x</em> axis, then we need to specify which data values fall onto particular positions along this axis. Similarly, we may need to specify which data values are represented by particular shapes or colors. This mapping between data values and aesthetics values is created via <em>scales</em>. A scale defines a unique mapping between data and aesthetics (Figure <a href="aesthetic-mapping.html#fig:basic-scales-example">2.2</a>). Importantly, a scale must be one-to-one, such that for each specific data value there is exactly one aesthetics value and vice versa. If a scale isn’t one-to-one, then the data visualization becomes ambiguous.</p>

<div class="figure" style="text-align: center"><span id="fig:basic-scales-example"></span>
<img src="aesthetic_mapping_files/figure-html/basic-scales-example-1.png" alt="Scales link data values to aesthetics. Here, the numbers 1 through 4 have been mapped onto a position scale, a shape scale, and a color scale. For each scale, each number corresponds to a unique position, shape, or color and vice versa." width="1155" />
<img src="aesthetic_mapping_files/figure-html/basic-scales-example-1.png" alt="Scales link data values to aesthetics. Here, the numbers 1 through 4 have been mapped onto a position scale, a shape scale, and a color scale. For each scale, each number corresponds to a unique position, shape, or color and vice versa." width="577.5" />
<p class="caption">
Figure 2.2: Scales link data values to aesthetics. Here, the numbers 1 through 4 have been mapped onto a position scale, a shape scale, and a color scale. For each scale, each number corresponds to a unique position, shape, or color and vice versa.
</p>
</div>
<p>Let’s put things into practice. We can take the dataset shown in Table <a href="aesthetic-mapping.html#tab:data-example">2.2</a>, map temperature onto the <em>y</em> axis, day of the year onto the <em>x</em> axis, location onto color, and visualize these aesthetics with solid lines. The result is a standard line plot showing the temperature normals at the four locations as they change during the year (Figure <a href="aesthetic-mapping.html#fig:temp-normals-vs-time">2.3</a>).</p>

<div class="figure" style="text-align: center"><span id="fig:temp-normals-vs-time"></span>
<img src="aesthetic_mapping_files/figure-html/temp-normals-vs-time-1.png" alt="Daily temperature normals for four selected locations in the U.S. Temperature is mapped to the y axis, day of the year to the x axis, and location to line color. Data source: NOAA." width="1260" />
<img src="aesthetic_mapping_files/figure-html/temp-normals-vs-time-1.png" alt="Daily temperature normals for four selected locations in the U.S. Temperature is mapped to the y axis, day of the year to the x axis, and location to line color. Data source: NOAA." width="630" />
<p class="caption">
Figure 2.3: Daily temperature normals for four selected locations in the U.S. Temperature is mapped to the <em>y</em> axis, day of the year to the <em>x</em> axis, and location to line color. Data source: NOAA.
</p>
</div>
<p>Figure <a href="aesthetic-mapping.html#fig:temp-normals-vs-time">2.3</a> is a fairly standard visualization for a temperature curve and likely the visualization most data scientists would intuitively choose first. However, it is up to us which variables we map onto which scales. For example, instead of mapping temperature onto the <em>y</em> axis and location onto color, we can do the opposite. Because now the key variable of interest (temperature) is shown as color, we need to show sufficiently large colored areas for the color to convey useful information <span class="citation">(Stone, Albers Szafir, and Setlur <a href="#ref-Stone_et_al_2014">2014</a>)</span>. Therefore, for this visualization I have chosen squares instead of lines, one for each month and location, and I have colored them by the average temperature normal for each month (Figure <a href="aesthetic-mapping.html#fig:four-locations-temps-by-month">2.4</a>).</p>

<div class="figure" style="text-align: center"><span id="fig:four-locations-temps-by-month"></span>
<img src="aesthetic_mapping_files/figure-html/four-locations-temps-by-month-1.png" alt="Monthly normal mean temperatures for four locations in the U.S. Data source: NOAA" width="1785" />
<img src="aesthetic_mapping_files/figure-html/four-locations-temps-by-month-1.png" alt="Monthly normal mean temperatures for four locations in the U.S. Data source: NOAA" width="892.5" />
<p class="caption">
Figure 2.4: Monthly normal mean temperatures for four locations in the U.S. Data source: NOAA
</p>
Expand All @@ -452,7 +452,7 @@ <h2><span class="header-section-number">2.2</span> Scales map data values onto a
<p>Both Figures <a href="aesthetic-mapping.html#fig:temp-normals-vs-time">2.3</a> and <a href="aesthetic-mapping.html#fig:four-locations-temps-by-month">2.4</a> used three scales in total, two position scales and one color scale. This is a typical number of scales for a basic visualization, but we can use more than three scales at once. Figure <a href="aesthetic-mapping.html#fig:mtcars-five-scale">2.5</a> uses five scales, two position scales, one color scale, one size scale, and one shape scale, and all scales represent a different variable from the dataset.</p>

<div class="figure" style="text-align: center"><span id="fig:mtcars-five-scale"></span>
<img src="aesthetic_mapping_files/figure-html/mtcars-five-scale-1.png" alt="Fuel efficiency versus displacement, for 32 cars (1973–74 models). This figure uses five separate scales to represent data: (i) the x axis (displacement); (ii) the y axis (fuel efficiency); (iii) the color of the data points (power); (iv) the size of the data points (weight); and (v) the shape of the data points (number of cylinders). Four of the five variables displayed (displacement, fuel efficiency, power, and weight) are numerical continuous. The remaining one (number of cylinders) can be considered to be either numerical discrete or qualitative ordered. Data source: Motor Trend, 1974." width="1260" />
<img src="aesthetic_mapping_files/figure-html/mtcars-five-scale-1.png" alt="Fuel efficiency versus displacement, for 32 cars (1973–74 models). This figure uses five separate scales to represent data: (i) the x axis (displacement); (ii) the y axis (fuel efficiency); (iii) the color of the data points (power); (iv) the size of the data points (weight); and (v) the shape of the data points (number of cylinders). Four of the five variables displayed (displacement, fuel efficiency, power, and weight) are numerical continuous. The remaining one (number of cylinders) can be considered to be either numerical discrete or qualitative ordered. Data source: Motor Trend, 1974." width="630" />
<p class="caption">
Figure 2.5: Fuel efficiency versus displacement, for 32 cars (1973–74 models). This figure uses five separate scales to represent data: (i) the <em>x</em> axis (displacement); (ii) the <em>y</em> axis (fuel efficiency); (iii) the color of the data points (power); (iv) the size of the data points (weight); and (v) the shape of the data points (number of cylinders). Four of the five variables displayed (displacement, fuel efficiency, power, and weight) are numerical continuous. The remaining one (number of cylinders) can be considered to be either numerical discrete or qualitative ordered. Data source: <em>Motor Trend</em>, 1974.
</p>
Expand Down
10 changes: 5 additions & 5 deletions _book_production/aesthetic_mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Aesthetics describe every aspect of a given graphical element. A few examples ar
(ref:common-aesthetics) Commonly used aesthetics in data visualization: position, shape, size, color, line width, line type. Some of these aesthetics can represent both continuous and discrete data (position, size, line width, color) while others can only represent discrete data (shape, line type).

<div class="figure" style="text-align: center">
<img src="aesthetic_mapping_files/figure-html/common-aesthetics-1.png" alt="(ref:common-aesthetics)" width="1260" />
<img src="aesthetic_mapping_files/figure-html/common-aesthetics-1.png" alt="(ref:common-aesthetics)" width="630" />
<p class="caption">(\#fig:common-aesthetics)(ref:common-aesthetics)</p>
</div>

Expand Down Expand Up @@ -86,7 +86,7 @@ To map data values onto aesthetics, we need to specify which data values corresp
(ref:basic-scales-example) Scales link data values to aesthetics. Here, the numbers 1 through 4 have been mapped onto a position scale, a shape scale, and a color scale. For each scale, each number corresponds to a unique position, shape, or color and vice versa.

<div class="figure" style="text-align: center">
<img src="aesthetic_mapping_files/figure-html/basic-scales-example-1.png" alt="(ref:basic-scales-example)" width="1155" />
<img src="aesthetic_mapping_files/figure-html/basic-scales-example-1.png" alt="(ref:basic-scales-example)" width="577.5" />
<p class="caption">(\#fig:basic-scales-example)(ref:basic-scales-example)</p>
</div>

Expand All @@ -96,7 +96,7 @@ Let's put things into practice. We can take the dataset shown in Table \@ref(tab
(ref:temp-normals-vs-time) Daily temperature normals for four selected locations in the U.S. Temperature is mapped to the *y* axis, day of the year to the *x* axis, and location to line color. Data source: NOAA.

<div class="figure" style="text-align: center">
<img src="aesthetic_mapping_files/figure-html/temp-normals-vs-time-1.png" alt="(ref:temp-normals-vs-time)" width="1260" />
<img src="aesthetic_mapping_files/figure-html/temp-normals-vs-time-1.png" alt="(ref:temp-normals-vs-time)" width="630" />
<p class="caption">(\#fig:temp-normals-vs-time)(ref:temp-normals-vs-time)</p>
</div>

Expand All @@ -105,7 +105,7 @@ Figure \@ref(fig:temp-normals-vs-time) is a fairly standard visualization for a
(ref:four-locations-temps-by-month) Monthly normal mean temperatures for four locations in the U.S. Data source: NOAA

<div class="figure" style="text-align: center">
<img src="aesthetic_mapping_files/figure-html/four-locations-temps-by-month-1.png" alt="(ref:four-locations-temps-by-month)" width="1785" />
<img src="aesthetic_mapping_files/figure-html/four-locations-temps-by-month-1.png" alt="(ref:four-locations-temps-by-month)" width="892.5" />
<p class="caption">(\#fig:four-locations-temps-by-month)(ref:four-locations-temps-by-month)</p>
</div>

Expand All @@ -117,7 +117,7 @@ Both Figures \@ref(fig:temp-normals-vs-time) and \@ref(fig:four-locations-temps-
(ref:mtcars-five-scale) Fuel efficiency versus displacement, for 32 cars (1973--74 models). This figure uses five separate scales to represent data: (i) the *x* axis (displacement); (ii) the *y* axis (fuel efficiency); (iii) the color of the data points (power); (iv) the size of the data points (weight); and (v) the shape of the data points (number of cylinders). Four of the five variables displayed (displacement, fuel efficiency, power, and weight) are numerical continuous. The remaining one (number of cylinders) can be considered to be either numerical discrete or qualitative ordered. Data source: *Motor Trend*, 1974.

<div class="figure" style="text-align: center">
<img src="aesthetic_mapping_files/figure-html/mtcars-five-scale-1.png" alt="(ref:mtcars-five-scale)" width="1260" />
<img src="aesthetic_mapping_files/figure-html/mtcars-five-scale-1.png" alt="(ref:mtcars-five-scale)" width="630" />
<p class="caption">(\#fig:mtcars-five-scale)(ref:mtcars-five-scale)</p>
</div>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 33a958d

Please sign in to comment.