Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions 02_activities/assignments/Assignment3_Viz1.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
library(ggplot2)
library(dplyr)

df <- read.csv('/Users/carla/Downloads/4cc07c1b-62ed-4ece-a2a4-d05d0f45081c.csv')

# Trim whitespace
df <- df %>% mutate(across(c(GEOGRAPHY, IMMIGRANT, TYPE.OF.WORK, EDUCATION, AGE.GROUP), trimws))

# Filter
base <- df %>%
filter(IMMIGRANT == "Total",
TYPE.OF.WORK == "Full-time",
AGE.GROUP == "25 - 64",
GEOGRAPHY == "Canada")

EDU_LEVELS <- c("0 - 8 years", "High school graduate", "Bachelor's degree", "Above bachelor's degree")
LINE_COLORS <- c("#a8d8a2", "#81c784", "#6f9f6f", "#1e3f1e")
TOTAL_EDU <- "Total, all education levels"

edu_data <- base %>%
filter(EDUCATION %in% EDU_LEVELS) %>%
mutate(EDUCATION = factor(EDUCATION, levels = EDU_LEVELS))

total_data <- base %>%
filter(EDUCATION == TOTAL_EDU) %>%
mutate(EDUCATION = TOTAL_EDU)

# X-axis: label only every 5 years
all_years <- sort(unique(base$YEAR))
year_labels <- ifelse(all_years %% 5 == 0, as.character(all_years), "")

ggplot() +
# Coloured lines per education level
geom_line(data = edu_data,
aes(x = YEAR, y = Both.sexes, colour = EDUCATION), linewidth = 1) +
geom_point(data = edu_data,
aes(x = YEAR, y = Both.sexes, colour = EDUCATION), size = 1.5) +
# Black dashed total line
geom_line(data = total_data,
aes(x = YEAR, y = Both.sexes, linetype = EDUCATION),
colour = "black", linewidth = 1.2) +
# Colour scale for education lines
scale_colour_manual(values = setNames(LINE_COLORS, EDU_LEVELS)) +
scale_linetype_manual(values = setNames("dashed", TOTAL_EDU),
name = NULL) +
# X-axis: tick every year, label every 5
scale_x_continuous(breaks = all_years, labels = year_labels) +
labs(
title = "Hourly Wage by Education Level\n(Both Sexes, Full-time, Age 25–64)",
x = "Year",
y = "Median Hourly Wage (CAD)",
colour = NULL
) +
theme_minimal(base_size = 13) +
theme(
plot.title = element_text(face = "bold", hjust = 0.5),
axis.text.x = element_text( hjust = 1, size = 10),
axis.text.y = element_text(size = 12),
legend.position = "top",
legend.text = element_text(size = 11)
)

3,135 changes: 3,135 additions & 0 deletions 02_activities/assignments/assignment1_annotatedCode.ipynb

Large diffs are not rendered by default.

Binary file added 02_activities/assignments/assignment3_Viz1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions 02_activities/assignments/assignment3_Viz2.ipynb

Large diffs are not rendered by default.

Binary file added 02_activities/assignments/assignment3_Viz2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 02_activities/assignments/assignment3_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 10 additions & 11 deletions 02_activities/assignments/assignment_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@
- For each visualization (good and bad):
- Explain (with reference to material covered up to date, along with readings and other scholarly sources, as needed) why you classified that visualization the way you did.
```
Your answer...



1. bad (https://public.tableau.com/app/profile/department.of.statistics.malaysia/viz/PopulationStatisticsPortal/PopulationStatistics):

The visualization of the Malaysian population suffers from high cognitive overload due to an overly complex presentation style despite the relatively limited intrinsic information content. Numerous seemingly arbitrary colors, such as bright green for births and grey for deaths, as well as the excessive use of human icons instead of simpler bar charts, increase the extraneous cognitive load without adding clarity. While some grouping follows the Gestalt principle of proximity, the absence of clear visual enclosure makes the layout appear cluttered and disjointed. Additionally, the information is presented largely in parallel, without an intuitive reading or information flow to guide the viewer through the graphic. The overall unclean layout also reduces the perceived factual reliability of the visualization. Finally, several numerical values are displayed with unnecessary precision, where rounded numbers would have improved readability and accessibility.

2. good (https://public.tableau.com/app/profile/sdma.oxford.university/viz/UniversityofOxford-StudentStatistics/AtaGlance):

The visualization of the University of Oxford student statistics is a strong example of effective information design, as it presents a high amount of information while maintaining clarity and readability. The graphic makes good use of Gestalt principles, particularly enclosure, by clearly grouping related data such as the world map and temporal trend analyses. A coherent and limited color scheme, together with familiar chart types, further supports a reduced cognitive load on the reader. The information flow is especially well designed, progressing hierarchically from broad overview statistics - such as total student numbers and percentages on the top - to more specific demographic categories including course type, domicile, and ethnicity, before finally introducing time-dependent trends for each category – on the bottom. This gradual increase in informational complexity guides the viewer naturally through the graphic while minimizing extraneous cognitive load. Rounded numbers (explicitly pointed out in the foot note) improve readability without sacrificing meaning. In addition, the visualization maintains a neutral and factual appearance, underscored by the clean layout and the effective presentation of high-dimensional data. For example, the temporal trend plots having a filled background makes it easy to visually compare it against the summarized percentages shown alongside.


```
- How could this data visualization have been improved?
```
Your answer...






1. bad:
The graphic could be improved by creating a clearer information hierarchy. Furthermore, replacing the human icons with conventional bar charts would reduce unnecessary visual complexity and allow for faster quantitative comparison. Additionally, applying the Gestalt principle of enclosure (instead of different colors) through the use of rectangles or clearly separated sections would help organize related information and create a cleaner overall layout. The visualization would also benefit from a more intentional reading flow, for example by using numbering, alignment, or continuity cues to guide the viewer through the information in a logical sequence rather than presenting all elements in parallel. Together, these changes would reduce cognitive load and improve both readability and perceived clarity of the data presentation.

2. good
Improvements would mainly be focused on the map representation: annotating some number on the map would make quantification of student origin easier. Numbering of each section would help effective referencing of the specific information content.

```
- Word count should not exceed (as a maximum) 500 words for each visualization (i.e.
Expand Down
33 changes: 32 additions & 1 deletion 02_activities/assignments/assignment_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,55 @@
- We will finish this class by giving you the chance to use what you have learned in a practical context, by creating data visualizations from raw data.
- Choose a dataset of interest from the [City of Toronto’s Open Data Portal](https://www.toronto.ca/city-government/data-research-maps/open-data/) or [Ontario’s Open Data Catalogue](https://data.ontario.ca/).
- Using Python and one other data visualization software (Excel or free alternative, Tableau Public, any other tool you prefer), create two distinct visualizations from your dataset of choice.
> URL data was sourced from: https://data.ontario.ca/dataset/wages-by-education-level


- For each visualization, describe and justify:
> What software did you use to create your data visualization?

I used python (Viz 2) and R (Viz 1) to create the graphs and power point for some more free annotations.

> Who is your intended audience?

Viz 1&2) The intended audience are people (specifically men and woman in comparison) who are considering doing a highschool vs university degree and are interested in how it changes their wages.

> What information or message are you trying to convey with your visualization?

Viz 1) the graphic is showing the progression of wages through the years.
Viz 2) the barplot provides a comparison in wages between degrees and men and women.

> What aspects of design did you consider when making your visualization? How did you apply them? With what elements of your plots?

I adjusted the color schemes to not be overbearing. For consistency, I highlightd the average values both in black and bold to give a good idea of averge trends in both visualizations.
Viz 1) I adjusted the number of tick labels so there are not too many details. Colors are chosen as a sequence of green values to highlight the progression in level of degree.
Viz 2) As the graph is not very complex I was able to annotade the bar plots with the actual number values.

> How did you ensure that your data visualizations are reproducible? If the tool you used to make your data visualization is not reproducible, how will this impact your data visualization?

Viz 1&2) It is reproducible based on the code I used and how i referenced the data from the csv file.

> How did you ensure that your data visualization is accessible?

large fonts (>12), not too many colors, black for the most important informaiton.
Viz 1 ) Considering that the area of the lines is small, one would prefer very distinct colors. However, as I wanted to keep a logical progression in degree level with the colors, I comprimised by using a large dynamic range in color hue.
Viz 2) As the bars cover a large area, using two shades of bk=lue does not affect the color distinction ability strongly.

> Who are the individuals and communities who might be impacted by your visualization?

All workers across canada.
Viz 1) especially workers with a higher degree of education.
Viz 2) men and women in particular. No focus on other genders however.

> How did you choose which features of your chosen dataset to include or exclude from your visualization?


Viz 1) I wanted to focus the direct correlation between level of degree and wage and it's progressio in time. Differences due to age class, immigration status etc were given in the dataset as well, but I ommited them as they would better be underscored in seperate graphs. before choosing this final information representation i also compared differences across data across all Canada vs only ontario, but as I havent seen big differences, I chose to ommit the ontario data and focus on across Canada.
Viz 2) Here the main focus lies on the difference in pay between men and women. As there are pronounced differences across all ages, level of degress etc, I decided to only report the average values (over all levels of degree) and a large age group that encompasses most of the working population (25-64 years old).

> What ‘underwater labour’ contributed to your final data visualization product?

Viz 1&2) - preprocessing and filtering what information of the file i want to show
Viz 1) Choosing whether I want to include markers or not (for examole average curve does not have markers as it woul dhave been too busy with the dashed line style)
Viz 2) - changes colorschemes (first i had women in pink in the bar chart and men in blue but it was too overwhelming)

- This assignment is intentionally open-ended - you are free to create static or dynamic data visualizations, maps, or whatever form of data visualization you think best communicates your information to your audience of choice!
- Total word count should not exceed **(as a maximum) 1000 words**
Expand Down