Skip to content

Commit cc7d936

Browse files
added better barplot discussion
1 parent bc659ef commit cc7d936

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

source/viz.Rmd

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -895,10 +895,13 @@ islands_df
895895
Here, we have a data frame of Earth's landmasses,
896896
and are trying to compare their sizes.
897897
The right type of visualization to answer this question is a bar plot.
898-
In a bar plot, the height of the bar represents the value of a summary statistic
899-
(usually a size, count, proportion or percentage).
900-
They are particularly useful for comparing summary statistics between different
901-
groups of a categorical variable.
898+
In a bar plot, the height of each bar represents the value of an *amount*
899+
(a size, count, proportion, percentage, etc).
900+
They are particularly useful for comparing counts or proportions across different
901+
groups of a categorical variable. Note, however, that bar plots should generally not be
902+
used to display mean or median values, as they hide important information about
903+
the variation of the data. Instead it's better to show the distribution of
904+
all the individual data points, e.g., using a histogram, which we will discuss further in Section \@ref(histogramsviz).
902905

903906
We specify that we would like to use a bar plot
904907
via the `geom_bar` function in `ggplot2`.
@@ -995,7 +998,7 @@ visualization for answering our original questions. Landmasses are organized by
995998
their size, and continents are colored differently than other landmasses,
996999
making it quite clear that continents are the largest seven landmasses.
9971000

998-
### Histograms: the Michelson speed of light data set
1001+
### Histograms: the Michelson speed of light data set {#histogramsviz}
9991002
The `morley` data set \index{Michelson speed of light}
10001003
contains measurements of the speed of light
10011004
collected in experiments performed in 1879.

0 commit comments

Comments
 (0)