oldoc63 / learningDS

Learning DS with Codecademy and Books
0 stars 0 forks source link

Introduction to Bar Charts #505

Open oldoc63 opened 1 year ago

oldoc63 commented 1 year ago

Bar charts are generally used to visualize the relative frequencies of categories within a variable. Therefore, they are primarily helpful for visually summarizing categorical variables rather than quantitative variables. If you can organize your variable into distinct categories, a bar chart is often a great option.

Once you have your distinct categories, a bar chart is best used to display the different value counts of each category. We also compare means, but we would recommend using a side by side box plot for that instead because they give a full picture of the five-number summary.

oldoc63 commented 1 year ago

Vertical vs. Horizontal Bar Charts

Within a bar chart, we have two axes. One axis represents the discrete values within a categorical variable we are comparing, while the other axis measures the counts of each of these values. Depending of how we orient these axes, we can either have a horizontal bar chart or a vertical bar chart.

oldoc63 commented 1 year ago

You may notice that bar charts and histograms look almost identical. However, there are key differences between them:

https://static-assets.codecademy.com/Paths/data-analyst-career-path/barcharts_piecharts_lesson/bar_hist.svg

oldoc63 commented 1 year ago

Bar Chart Area

Let's go over one of the most important concepts about bar charts. The bars of a chart have a couple of key features:

These features make a bar chart super dependable for representing categorical data. For any chart like a bar chart, the areas we use to represent values must always be equivalent to the relative sizes of the values they represent. Otherwise, readers could be misled and potentially identify patterns that do not actually exist.