diff --git a/_book_production/balance_data_context_files/figure-html/price-plot-ggplot-default-1.png b/_book_production/balance_data_context_files/figure-html/price-plot-ggplot-default-1.png index cb30d32f..43e93813 100644 Binary files a/_book_production/balance_data_context_files/figure-html/price-plot-ggplot-default-1.png and b/_book_production/balance_data_context_files/figure-html/price-plot-ggplot-default-1.png differ diff --git a/_book_production/balance_data_context_files/figure-html/price-plot-hgrid-1.png b/_book_production/balance_data_context_files/figure-html/price-plot-hgrid-1.png index 28328897..5e4ca22f 100644 Binary files a/_book_production/balance_data_context_files/figure-html/price-plot-hgrid-1.png and b/_book_production/balance_data_context_files/figure-html/price-plot-hgrid-1.png differ diff --git a/_book_production/balance_data_context_files/figure-html/price-plot-no-grid-1.png b/_book_production/balance_data_context_files/figure-html/price-plot-no-grid-1.png index dfbf586c..efecc575 100644 Binary files a/_book_production/balance_data_context_files/figure-html/price-plot-no-grid-1.png and b/_book_production/balance_data_context_files/figure-html/price-plot-no-grid-1.png differ diff --git a/_book_production/balance_data_context_files/figure-html/price-plot-refline-1.png b/_book_production/balance_data_context_files/figure-html/price-plot-refline-1.png index 503ab247..1ea0f2f1 100644 Binary files a/_book_production/balance_data_context_files/figure-html/price-plot-refline-1.png and b/_book_production/balance_data_context_files/figure-html/price-plot-refline-1.png differ diff --git a/_book_production/color-pitfalls.html b/_book_production/color-pitfalls.html index 90bde4e2..ce8d4631 100644 --- a/_book_production/color-pitfalls.html +++ b/_book_production/color-pitfalls.html @@ -298,7 +298,7 @@

19.2 Using non-monotonic color sc

In Chapter 4, I listed two critical conditions for designing sequential color scales that can represent data values: The colors need to clearly indicate which data values are larger or smaller than which other ones, and the differences between colors need to visualize the corresponding differences between data values. Unfortunately, several existing color scales—including very popular ones—violate one or both of these conditions. The most popular such scale is the rainbow scale (Figure 19.4). It runs through all possible colors in the color spectrum. This means the scale is effectively circular; the colors at the beginning and the end are nearly the same (dark red). If these two colors end up next to each other in a plot, we do not instinctively perceive them as representing data values that are maximally apart. In addition, the scale is highly non-monotonic. It has regions where colors change very slowly and others when colors change rapidly. This lack of monotonicity becomes particularly apparent if we look at the color scale in grayscale (Figure 19.4). The scale goes from medium dark to light to very dark and back to medium dark, and there are large stretches where lightness changes very little followed by relatively narrow stretches with large changes in lightness.

-The rainbow colorscale is highly non-monotonic. This becomes clearly visible by converting the colors to gray values. From left to right, the scale goes from moderately dark to light to very dark and back to moderately dark. In addition, the changes in lightness are very non-uniform. The lightest part of the scale (corresponding to the colors yellow, light green, and cyan) takes up almost a third of the entire scale while the darkest part (corresponding to dark blue) is concentrated in a narrow region of the scale. +The rainbow colorscale is highly non-monotonic. This becomes clearly visible by converting the colors to gray values. From left to right, the scale goes from moderately dark to light to very dark and back to moderately dark. In addition, the changes in lightness are very non-uniform. The lightest part of the scale (corresponding to the colors yellow, light green, and cyan) takes up almost a third of the entire scale while the darkest part (corresponding to dark blue) is concentrated in a narrow region of the scale.

Figure 19.4: The rainbow colorscale is highly non-monotonic. This becomes clearly visible by converting the colors to gray values. From left to right, the scale goes from moderately dark to light to very dark and back to moderately dark. In addition, the changes in lightness are very non-uniform. The lightest part of the scale (corresponding to the colors yellow, light green, and cyan) takes up almost a third of the entire scale while the darkest part (corresponding to dark blue) is concentrated in a narrow region of the scale.

@@ -318,7 +318,7 @@

19.3 Not designing for color-visi

As discussed in Chapter 4, there are three fundamental types of color scales used in data visualization: sequential scales, diverging scales, and qualitative scales. Of these three, sequential scales will generally not cause any problems for people with color-vision deficiency (cvd), since a properly designed sequential scale should present a continuous gradient from dark to light colors. Figure 19.6 shows the Heat scale from Figure 4.3 in simulated versions of deuteranomaly, protanomaly, and tritanomaly. While none of these cvd-simulated scales look like the original, they all present a clear gradient from dark to light and they all work well to convey the magnitude of a data value.

-Color-vision deficiency (cvd) simulation of the sequential color scale Heat, which runs from dark red to light yellow. From left to right and top to bottom, we see the original scale and the scale as seen under deuteranomaly, protanomaly, and tritanomaly simulations. Even though the specific colors look different under the three types of cvd, in each case we can see a clear gradient from dark to light. Therefore, this color scale is safe to use for cvd. +Color-vision deficiency (cvd) simulation of the sequential color scale Heat, which runs from dark red to light yellow. From left to right and top to bottom, we see the original scale and the scale as seen under deuteranomaly, protanomaly, and tritanomaly simulations. Even though the specific colors look different under the three types of cvd, in each case we can see a clear gradient from dark to light. Therefore, this color scale is safe to use for cvd.

Figure 19.6: Color-vision deficiency (cvd) simulation of the sequential color scale Heat, which runs from dark red to light yellow. From left to right and top to bottom, we see the original scale and the scale as seen under deuteranomaly, protanomaly, and tritanomaly simulations. Even though the specific colors look different under the three types of cvd, in each case we can see a clear gradient from dark to light. Therefore, this color scale is safe to use for cvd.

@@ -326,14 +326,14 @@

19.3 Not designing for color-visi

Things become more complicated for diverging scales, because popular color contrasts can become indistinguishable under cvd. In particular, the colors red and green provide about the strongest contrast for people with normal color vision but become nearly indistinguishable for deutans (people with deuteranomaly) or protans (people with protanomaly) (Figure 19.7). Similarly, blue-green contrasts are visible for deutans and protans but become indistinguishable for tritans (people with tritanomaly) (Figure 19.8).

-A red–green contrast becomes indistinguishable under red–green cvd (deuteranomaly or protanomaly). +A red–green contrast becomes indistinguishable under red–green cvd (deuteranomaly or protanomaly).

Figure 19.7: A red–green contrast becomes indistinguishable under red–green cvd (deuteranomaly or protanomaly).

-A blue–green contrast becomes indistinguishable under blue–yellow cvd (tritanomaly). +A blue–green contrast becomes indistinguishable under blue–yellow cvd (tritanomaly).

Figure 19.8: A blue–green contrast becomes indistinguishable under blue–yellow cvd (tritanomaly).

@@ -341,7 +341,7 @@

19.3 Not designing for color-visi

With these examples, it might seem that it is nearly impossible to find two contrasting colors that are safe under all forms of cvd. However, the situation is not that dire. It is often possible to make slight modifications to the colors such that they have the desired character while also being safe for cvd. For example, the ColorBrewer PiYG (pink to yellow-green) scale from Figure 4.5 looks red–green to people with normal color vision yet remains distinguishable for people with cvd (Figure 19.9).

-The ColorBrewer PiYG (pink to yellow-green) scale from Figure 4.5 looks like a red–green contrast to people with regular color vision but works for all forms of color-vision deficiency. It works because the reddish color is actually pink (a mix of red and blue) while the greenish color also contains yellow. The difference in the blue component between the two colors can be picked up even by deutans or protans, and the difference in the red component can be picked up by tritans. +The ColorBrewer PiYG (pink to yellow-green) scale from Figure 4.5 looks like a red–green contrast to people with regular color vision but works for all forms of color-vision deficiency. It works because the reddish color is actually pink (a mix of red and blue) while the greenish color also contains yellow. The difference in the blue component between the two colors can be picked up even by deutans or protans, and the difference in the red component can be picked up by tritans.

Figure 19.9: The ColorBrewer PiYG (pink to yellow-green) scale from Figure 4.5 looks like a red–green contrast to people with regular color vision but works for all forms of color-vision deficiency. It works because the reddish color is actually pink (a mix of red and blue) while the greenish color also contains yellow. The difference in the blue component between the two colors can be picked up even by deutans or protans, and the difference in the red component can be picked up by tritans.

@@ -436,7 +436,7 @@

19.3 Not designing for color-visi

While there are several good, cvd-safe color scales readily available, we need to recognize that they are no magic bullets. It is very possible to use a cvd-safe scale and yet produce a figure a person with cvd cannot decipher. One critical parameter is the size of the colored graphical elements. Colors are much easier to distinguish when they are applied to large areas than to small ones or thin lines (Stone, Albers Szafir, and Setlur 2014). And this effect is exacerbated under cvd (Figure 19.11). In addition to the various color-design considerations discussed in this chapter and in Chapter 4, I recommend to view color figures under cvd simulations to get a sense of what they may look like for a person with cvd. There are several online services and desktop apps available that allow users to run arbitrary figures through a cvd simulation.

-Colored elements become difficult to distinguish at small sizes. The top left panel (labeled “original”) shows four rectangles, four thick lines, four thin lines, and four groups of points, all colored in the same four colors. We can see that the colors become more difficult to distinguish the smaller or thinner the visual elements are. This problem becomes exacerbated in the cvd simulations, where the colors are already more difficult to distinguish even for the large graphical elements. +Colored elements become difficult to distinguish at small sizes. The top left panel (labeled “original”) shows four rectangles, four thick lines, four thin lines, and four groups of points, all colored in the same four colors. We can see that the colors become more difficult to distinguish the smaller or thinner the visual elements are. This problem becomes exacerbated in the cvd simulations, where the colors are already more difficult to distinguish even for the large graphical elements.

Figure 19.11: Colored elements become difficult to distinguish at small sizes. The top left panel (labeled “original”) shows four rectangles, four thick lines, four thin lines, and four groups of points, all colored in the same four colors. We can see that the colors become more difficult to distinguish the smaller or thinner the visual elements are. This problem becomes exacerbated in the cvd simulations, where the colors are already more difficult to distinguish even for the large graphical elements.

diff --git a/_book_production/pitfalls_of_color_use.md b/_book_production/pitfalls_of_color_use.md index 7f31bbd9..41d75839 100644 --- a/_book_production/pitfalls_of_color_use.md +++ b/_book_production/pitfalls_of_color_use.md @@ -52,7 +52,7 @@ In Chapter \@ref(color-basics), I listed two critical conditions for designing s (ref:rainbow-desaturated) The rainbow colorscale is highly non-monotonic. This becomes clearly visible by converting the colors to gray values. From left to right, the scale goes from moderately dark to light to very dark and back to moderately dark. In addition, the changes in lightness are very non-uniform. The lightest part of the scale (corresponding to the colors yellow, light green, and cyan) takes up almost a third of the entire scale while the darkest part (corresponding to dark blue) is concentrated in a narrow region of the scale.
-(ref:rainbow-desaturated) +(ref:rainbow-desaturated)

(\#fig:rainbow-desaturated)(ref:rainbow-desaturated)

@@ -76,7 +76,7 @@ As discussed in Chapter \@ref(color-basics), there are three fundamental types o (ref:heat-cvd-sim) Color-vision deficiency (cvd) simulation of the sequential color scale Heat, which runs from dark red to light yellow. From left to right and top to bottom, we see the original scale and the scale as seen under deuteranomaly, protanomaly, and tritanomaly simulations. Even though the specific colors look different under the three types of cvd, in each case we can see a clear gradient from dark to light. Therefore, this color scale is safe to use for cvd.
-(ref:heat-cvd-sim) +(ref:heat-cvd-sim)

(\#fig:heat-cvd-sim)(ref:heat-cvd-sim)

@@ -85,14 +85,14 @@ Things become more complicated for diverging scales, because popular color contr (ref:red-green-cvd-sim) A red--green contrast becomes indistinguishable under red--green cvd (deuteranomaly or protanomaly).
-(ref:red-green-cvd-sim) +(ref:red-green-cvd-sim)

(\#fig:red-green-cvd-sim)(ref:red-green-cvd-sim)

(ref:blue-green-cvd-sim) A blue--green contrast becomes indistinguishable under blue--yellow cvd (tritanomaly).
-(ref:blue-green-cvd-sim) +(ref:blue-green-cvd-sim)

(\#fig:blue-green-cvd-sim)(ref:blue-green-cvd-sim)

@@ -101,7 +101,7 @@ With these examples, it might seem that it is nearly impossible to find two cont (ref:PiYG-cvd-sim) The ColorBrewer PiYG (pink to yellow-green) scale from Figure \@ref(fig:diverging-scales) looks like a red--green contrast to people with regular color vision but works for all forms of color-vision deficiency. It works because the reddish color is actually pink (a mix of red and blue) while the greenish color also contains yellow. The difference in the blue component between the two colors can be picked up even by deutans or protans, and the difference in the red component can be picked up by tritans.
-(ref:PiYG-cvd-sim) +(ref:PiYG-cvd-sim)

(\#fig:PiYG-cvd-sim)(ref:PiYG-cvd-sim)

@@ -133,7 +133,7 @@ While there are several good, cvd-safe color scales readily available, we need t (ref:colors-thin-lines) Colored elements become difficult to distinguish at small sizes. The top left panel (labeled "original") shows four rectangles, four thick lines, four thin lines, and four groups of points, all colored in the same four colors. We can see that the colors become more difficult to distinguish the smaller or thinner the visual elements are. This problem becomes exacerbated in the cvd simulations, where the colors are already more difficult to distinguish even for the large graphical elements.
-(ref:colors-thin-lines) +(ref:colors-thin-lines)

(\#fig:colors-thin-lines)(ref:colors-thin-lines)

diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/PiYG-cvd-sim-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/PiYG-cvd-sim-1.png index 0c937679..7b59f54f 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/PiYG-cvd-sim-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/PiYG-cvd-sim-1.png differ diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/blue-green-cvd-sim-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/blue-green-cvd-sim-1.png index 4791cd16..5acc4ffd 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/blue-green-cvd-sim-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/blue-green-cvd-sim-1.png differ diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/colors-thin-lines-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/colors-thin-lines-1.png index db0f60b1..e0a24053 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/colors-thin-lines-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/colors-thin-lines-1.png differ diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/heat-cvd-sim-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/heat-cvd-sim-1.png index c62cbf26..22f30bd7 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/heat-cvd-sim-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/heat-cvd-sim-1.png differ diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/palette-Okabe-Ito-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/palette-Okabe-Ito-1.png index 426f4250..3f771a36 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/palette-Okabe-Ito-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/palette-Okabe-Ito-1.png differ diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/popgrowth-vs-popsize-bw-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/popgrowth-vs-popsize-bw-1.png index da007b16..b01d57f8 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/popgrowth-vs-popsize-bw-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/popgrowth-vs-popsize-bw-1.png differ diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/rainbow-desaturated-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/rainbow-desaturated-1.png index c4811b3f..7aad63be 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/rainbow-desaturated-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/rainbow-desaturated-1.png differ diff --git a/_book_production/pitfalls_of_color_use_files/figure-html/red-green-cvd-sim-1.png b/_book_production/pitfalls_of_color_use_files/figure-html/red-green-cvd-sim-1.png index 75ba5947..c0dd2cc8 100644 Binary files a/_book_production/pitfalls_of_color_use_files/figure-html/red-green-cvd-sim-1.png and b/_book_production/pitfalls_of_color_use_files/figure-html/red-green-cvd-sim-1.png differ diff --git a/_book_production/redundant-coding.html b/_book_production/redundant-coding.html index 40d1a05c..dab4d13a 100644 --- a/_book_production/redundant-coding.html +++ b/_book_production/redundant-coding.html @@ -268,7 +268,7 @@

20.1 Designing legends with redun

Surprisingly, the green and blue points look more distinct for people with red–green color-vision-deficiency (deuteranomaly or protanomaly) than for people with normal color vision (compare Figure 20.2, top row, to Figure 20.1). On the other hand, for people with blue–yellow deficiency (tritanomaly) the blue and green points look very similar (Figure 20.2, bottom left). And if we print out the figure in gray-scale (i.e., we desaturate the figure), we cannot distinguish any of the iris species (Figure 20.2, bottom right).

-Color-vision-deficiency simulation of Figure 20.1. +Color-vision-deficiency simulation of Figure 20.1.

Figure 20.2: Color-vision-deficiency simulation of Figure 20.1.

@@ -283,7 +283,7 @@

20.1 Designing legends with redun

-Color-vision-deficiency simulation of Figure 20.3. Because of the use of different point shapes, even the fully desaturated gray-scale version of the figure is legible. +Color-vision-deficiency simulation of Figure 20.3. Because of the use of different point shapes, even the fully desaturated gray-scale version of the figure is legible.

Figure 20.4: Color-vision-deficiency simulation of Figure 20.3. Because of the use of different point shapes, even the fully desaturated gray-scale version of the figure is legible.

@@ -313,7 +313,7 @@

20.1 Designing legends with redun

Matching the legend order to the data order is always helpful, but the benefits are particularly obvious under color-vision deficiency simulation (Figure 20.7). For example, it helps in the tritanomaly version of the figure, where the blue and the green become difficult to distinguish (Figure 20.7, bottom left). It also helps in the grayscale version (Figure 20.7, bottom right). Even though the two colors for Facebook and Alphabet have virtually the same gray value, we can see that Microsoft and Apple are represented by darker colors and take the bottom two spots. Therefore, we correctly assume that the highest line corresponds to Facebook and the second-highest line to Alphabet.

-Color-vision-deficiency simulation of Figure 20.6. +Color-vision-deficiency simulation of Figure 20.6.

Figure 20.7: Color-vision-deficiency simulation of Figure 20.6.

@@ -354,7 +354,7 @@

20.2 Designing figures without le

We can also use density plots such as the one in Figure 20.10 as a legend replacement, by placing the density plots into the margins of a scatter plot (Figure 20.11). This allows us to direct-label the marginal density plots rather than the central scatter plot and hence results in a figure that is somewhat less cluttered than Figure 20.9 with directly-labeled ellipses.

-Sepal width versus sepal length for three different iris species, with marginal density estimates of each variable for each species. +Sepal width versus sepal length for three different iris species, with marginal density estimates of each variable for each species.

Figure 20.11: Sepal width versus sepal length for three different iris species, with marginal density estimates of each variable for each species.

diff --git a/_book_production/redundant_coding.md b/_book_production/redundant_coding.md index 0a5340e6..9c26e34d 100644 --- a/_book_production/redundant_coding.md +++ b/_book_production/redundant_coding.md @@ -21,7 +21,7 @@ Surprisingly, the green and blue points look more distinct for people with red-- (ref:iris-scatter-one-shape-cvd) Color-vision-deficiency simulation of Figure \@ref(fig:iris-scatter-one-shape).
-(ref:iris-scatter-one-shape-cvd) +(ref:iris-scatter-one-shape-cvd)

(\#fig:iris-scatter-one-shape-cvd)(ref:iris-scatter-one-shape-cvd)

@@ -38,7 +38,7 @@ There are two simple improvements we can make to Figure \@ref(fig:iris-scatter-o (ref:iris-scatter-three-shapes-cvd) Color-vision-deficiency simulation of Figure \@ref(fig:iris-scatter-three-shapes). Because of the use of different point shapes, even the fully desaturated gray-scale version of the figure is legible.
-(ref:iris-scatter-three-shapes-cvd) +(ref:iris-scatter-three-shapes-cvd)

(\#fig:iris-scatter-three-shapes-cvd)(ref:iris-scatter-three-shapes-cvd)

@@ -73,7 +73,7 @@ Matching the legend order to the data order is always helpful, but the benefits (ref:tech-stocks-good-legend-cvd) Color-vision-deficiency simulation of Figure \@ref(fig:tech-stocks-good-legend).
-(ref:tech-stocks-good-legend-cvd) +(ref:tech-stocks-good-legend-cvd)

(\#fig:tech-stocks-good-legend-cvd)(ref:tech-stocks-good-legend-cvd)

@@ -119,7 +119,7 @@ We can also use density plots such as the one in Figure \@ref(fig:iris-densities (ref:iris-scatter-dens) Sepal width versus sepal length for three different iris species, with marginal density estimates of each variable for each species.
-(ref:iris-scatter-dens) +(ref:iris-scatter-dens)

(\#fig:iris-scatter-dens)(ref:iris-scatter-dens)

diff --git a/_book_production/redundant_coding_files/figure-html/iris-densities-direct-label-1.png b/_book_production/redundant_coding_files/figure-html/iris-densities-direct-label-1.png index efe404b9..ea6d23ef 100644 Binary files a/_book_production/redundant_coding_files/figure-html/iris-densities-direct-label-1.png and b/_book_production/redundant_coding_files/figure-html/iris-densities-direct-label-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/iris-scatter-dens-1.png b/_book_production/redundant_coding_files/figure-html/iris-scatter-dens-1.png index 15c51722..6aa35250 100644 Binary files a/_book_production/redundant_coding_files/figure-html/iris-scatter-dens-1.png and b/_book_production/redundant_coding_files/figure-html/iris-scatter-dens-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/iris-scatter-one-shape-cvd-1.png b/_book_production/redundant_coding_files/figure-html/iris-scatter-one-shape-cvd-1.png index 8c494aae..c6f50b33 100644 Binary files a/_book_production/redundant_coding_files/figure-html/iris-scatter-one-shape-cvd-1.png and b/_book_production/redundant_coding_files/figure-html/iris-scatter-one-shape-cvd-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/iris-scatter-three-shapes-cvd-1.png b/_book_production/redundant_coding_files/figure-html/iris-scatter-three-shapes-cvd-1.png index 30323f68..0e86df84 100644 Binary files a/_book_production/redundant_coding_files/figure-html/iris-scatter-three-shapes-cvd-1.png and b/_book_production/redundant_coding_files/figure-html/iris-scatter-three-shapes-cvd-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/iris-scatter-with-ellipses-1.png b/_book_production/redundant_coding_files/figure-html/iris-scatter-with-ellipses-1.png index 50bbfa5f..8c79a6ee 100644 Binary files a/_book_production/redundant_coding_files/figure-html/iris-scatter-with-ellipses-1.png and b/_book_production/redundant_coding_files/figure-html/iris-scatter-with-ellipses-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/tech-stocks-bad-legend-1.png b/_book_production/redundant_coding_files/figure-html/tech-stocks-bad-legend-1.png index 8069f712..ea6f9c1f 100644 Binary files a/_book_production/redundant_coding_files/figure-html/tech-stocks-bad-legend-1.png and b/_book_production/redundant_coding_files/figure-html/tech-stocks-bad-legend-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-1.png b/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-1.png index 0498399e..e0d134ac 100644 Binary files a/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-1.png and b/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-cvd-1.png b/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-cvd-1.png index 17405d90..3d455fab 100644 Binary files a/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-cvd-1.png and b/_book_production/redundant_coding_files/figure-html/tech-stocks-good-legend-cvd-1.png differ diff --git a/_book_production/redundant_coding_files/figure-html/tech-stocks-good-no-legend-1.png b/_book_production/redundant_coding_files/figure-html/tech-stocks-good-no-legend-1.png index e69861a7..c26cd120 100644 Binary files a/_book_production/redundant_coding_files/figure-html/tech-stocks-good-no-legend-1.png and b/_book_production/redundant_coding_files/figure-html/tech-stocks-good-no-legend-1.png differ diff --git a/_book_production/telling_a_story_files/figure-html/tech-stocks-diverse-1.png b/_book_production/telling_a_story_files/figure-html/tech-stocks-diverse-1.png index 5c2d0b2b..179a9a73 100644 Binary files a/_book_production/telling_a_story_files/figure-html/tech-stocks-diverse-1.png and b/_book_production/telling_a_story_files/figure-html/tech-stocks-diverse-1.png differ diff --git a/_book_production/telling_a_story_files/figure-html/tech-stocks-repetitive-1.png b/_book_production/telling_a_story_files/figure-html/tech-stocks-repetitive-1.png index 1664a10d..1828caf6 100644 Binary files a/_book_production/telling_a_story_files/figure-html/tech-stocks-repetitive-1.png and b/_book_production/telling_a_story_files/figure-html/tech-stocks-repetitive-1.png differ diff --git a/choosing_visualization_software.Rmd b/choosing_visualization_software.Rmd index 0a827e8b..758e597f 100644 --- a/choosing_visualization_software.Rmd +++ b/choosing_visualization_software.Rmd @@ -24,7 +24,7 @@ With minor modifications, we can apply these concepts to data visualization. A v Throughout this book, we have seen many examples of figures that reproduce but don't repeat other figures. For example, Chapter \@ref(avoid-line-drawings) shows several sets of figures where all figures in each set show the same data but each figure in each set looks somewhat different. Similarly, Figure \@ref(fig:lincoln-repro)a is a repeat of Figure \@ref(fig:lincoln-temp-jittered), down to the random jitter that was applied to each data point, whereas Figure \@ref(fig:lincoln-repro)b is only a reproduction of that figure. Figure \@ref(fig:lincoln-repro)b has different jitter than Figure \@ref(fig:lincoln-temp-jittered), and it also uses a sufficiently different visual design that the two figures look quite distinct, even if they clearly convey the same information about the data. -(ref:lincoln-repro) Repeat and reproduction of a figure. Part (a) is a near-complete repeat of Figure \@ref(fig:lincoln-temp-jittered). With exception of the exact sizes of the text elements and points, which were adjusted so the figure remains legible at the reduced size, the two figures are identical down to the random jitter that was applied to each point. By contrast, part (b) is a reproduction but not a repeat. In particular, the jitter in part (b) differs from the jitter in part (a) or in Figure \@ref(fig:lincoln-temp-jittered). +(ref:lincoln-repro) Repeat and reproduction of a figure. Part (a) is a repeat of Figure \@ref(fig:lincoln-temp-jittered). The two figures are identical down to the random jitter that was applied to each point. By contrast, part (b) is a reproduction but not a repeat. In particular, the jitter in part (b) differs from the jitter in part (a) or in Figure \@ref(fig:lincoln-temp-jittered). ```{r lincoln-repro, fig.width = 5.5*6/4.2, fig.asp = .32, fig.cap = '(ref:lincoln-repro)'} ggridges::lincoln_weather %>% diff --git a/figure_titles_captions.Rmd b/figure_titles_captions.Rmd index 02ad3a2d..2ce17a16 100644 --- a/figure_titles_captions.Rmd +++ b/figure_titles_captions.Rmd @@ -260,20 +260,29 @@ Figure \@ref(fig:table-examples) reproduces Table \@ref(tab:boxoffice-gross) fro (ref:table-examples) Examples of poorly and appropriately formatted tables, using the data from Table \@ref(tab:boxoffice-gross) in Chapter \@ref(visualizing-amounts). (a) This table violates numerous conventions of proper table formatting, including using vertical lines, using horizontal lines between data rows, and using centered data columns. (b) This table suffers from all problems of Table (a), and in addition it creates additional visual noise by alternating between very dark and very light rows. Also, the table header is not strongly visually separated from the table body. (c) This is an appropriately formatted table with a minimal design. (d) Colors can be used effectively to group data into rows, but the color differences should be subtle. The table header can be set off by using a stronger color. Data source: Box Office Mojo (http://www.boxofficemojo.com/). Used with permission -```{r table-examples, fig.width = 4.8*6/4.2, fig.asp = 0.58, fig.cap = '(ref:table-examples)'} +```{r table-examples, fig.width = 5*6/4.2, fig.asp = 0.51, fig.cap = '(ref:table-examples)'} boxoffice <- tibble( Rank = 1:5, - Title = c("Star Wars", "Jumanji", "Pitch Perfect 3", "Greatest Showman", "Ferdinand"), + Title = c("Star Wars: The Last Jedi", "Jumanji: Welcome to the Jungle ", "Pitch Perfect 3", "The Greatest Showman", "Ferdinand"), Amount = c("$71,565,498", "$36,169,328", "$19,928,525", "$8,805,843", "$7,316,746") ) -table_base_size = 12 +boxoffice_ctr <- tibble( + Rank = 1:5, + Title = c("Star Wars: The Last Jedi", " Jumanji: Welcome to the Jungle ", "Pitch Perfect 3", "The Greatest Showman", "Ferdinand"), + Amount = c("$71,565,498", "$36,169,328", "$19,928,525", "$8,805,843", "$7,316,746") +) + +table_base_size = 10 zgrob <- function(...) ggplot2::zeroGrob() tt1 <- ttheme_minimal( base_size = table_base_size, base_family = dviz_font_family, core = list( + fg_params = list( + fontface = rep(c(1L, 3L, 1L), each = 5) + ), bg_params = list( col = "black", lwd = 1 @@ -297,6 +306,7 @@ tt2 <- ttheme_default( base_family = dviz_font_family, core = list( fg_params = list( + fontface = rep(c(1L, 3L, 1L), each = 5), col = c("white", "black") ), bg_params = list( @@ -325,6 +335,7 @@ tt3 <- ttheme_minimal( padding = unit(c(4, 3.2), "mm"), core = list( fg_params = list( + fontface = rep(c(1L, 3L, 1L), each = 5), hjust = rep(c(0.5, 0, 1), each = 5), x = rep(c(0.5, 0.1, 0.9), each = 5) ), @@ -351,6 +362,7 @@ tt4 <- ttheme_default( base_family = dviz_font_family, core = list( fg_params = list( + fontface = rep(c(1L, 3L, 1L), each = 5), col = "black", hjust = rep(c(0.5, 0, 1), each = 5), x = rep(c(0.5, 0.1, 0.9), each = 5) @@ -392,11 +404,11 @@ hline_bottom <- segmentsGrob( gp = gpar(lwd = 0.75, col = "black") ) -t1 <- tableGrob(boxoffice, rows = rep("", nrow(boxoffice)), theme = tt1) +t1 <- tableGrob(boxoffice_ctr, rows = rep("", nrow(boxoffice)), theme = tt1) t1$layout$clip <- "off" t1 <- gtable_add_padding(t1, margin(14, 16, 0, -2)) -t2 <- tableGrob(boxoffice, rows = rep("", nrow(boxoffice)), theme = tt2) +t2 <- tableGrob(boxoffice_ctr, rows = rep("", nrow(boxoffice)), theme = tt2) t2$layout$clip <- "off" t2 <- gtable_add_padding(t2, margin(14, 16, 0, -2)) diff --git a/figures/jpeg_example_combined.idraw b/figures/jpeg_example_combined.idraw index 788cc3cc..6b2a0ce3 100644 Binary files a/figures/jpeg_example_combined.idraw and b/figures/jpeg_example_combined.idraw differ diff --git a/figures/jpeg_example_combined.pdf b/figures/jpeg_example_combined.pdf index ffecb8ab..83f76205 100644 Binary files a/figures/jpeg_example_combined.pdf and b/figures/jpeg_example_combined.pdf differ diff --git a/figures/jpeg_example_combined.png b/figures/jpeg_example_combined.png index 997e3b4d..23b863cd 100644 Binary files a/figures/jpeg_example_combined.png and b/figures/jpeg_example_combined.png differ diff --git a/figures/sequencing_costs-hires.png b/figures/sequencing_costs-hires.png new file mode 100644 index 00000000..06468474 Binary files /dev/null and b/figures/sequencing_costs-hires.png differ diff --git a/figures/sequencing_costs.png b/figures/sequencing_costs.png index 06468474..4a77d698 100644 Binary files a/figures/sequencing_costs.png and b/figures/sequencing_costs.png differ