### Question

In the context of this exercise, when do we use each type of graph shown?

### Answer

Depending on what you are trying to convey visually with data, certain graphs can be better suited for the task. The following are brief summaries of each graph and when you might apply them.

A **bar chart with error** has the qualities of a bar chart, which lets us see categorical data. The heights of each bar can represent the average of values in the category, and with the addition of error bars, we can see the range of all values from smallest to largest represented by the bottom and top lines of the error bar. You might use this to display the average grade of students categorized by college major.

A **line chart with error** has the qualities of a line chart, which lets us display values for a sequence of data points, connected with straight lines. The added shaded error lets us see a lower and upper bound that the values can fall between, similar to the bar chart with error. You might use this to show stock prices over time.

**Histograms** let us see frequencies of variables that fall within intervals, which we refer to as “bins”. The one displayed in this exercise is a specific type called a normalized histogram, such that the total area of all the rectangles in the histogram sum to 1. You might use histograms to show how many people there are within different age ranges in years, like 10-20, 20-30, and so on.

A **pie chart** lets us see how values contribute to a whole, like slices of a pie. Each wedge size is proportional to the fraction of each value of the total value. You might use a pie chart when showing the percentages of students in different college majors.

**Side by side charts** are bar charts where different sets of data are shown next to each other. This is useful to directly visualize and compare multiple sets of data with each other. You might use this to compare the average grades of students based on college major from different colleges.

Last, but not least, **stacked bars** allow us to see how individual values contribute toward a total value, similar to pie charts, but displayed as a vertical column and without the restriction of a set size, as you can keep adding to the bar’s total height. You might use stacked bars when showing the hours spent studying for different classes per day. The total height of each column would be total hours spent studying that day.