Plotting minimum wages over time
Let's look at the trends for the minimum wage in the United States. You have access to the dataset wages_stats
, containing the minimum, maximum, and median minimum wage for each year:
53x4 DataFrame
Row | year median max min
| Int64 Float64 Float64 Float64
____|_________________________________
1| 1968 8.55 15.61 8.55
...
All wages are adjusted for inflation, so you are looking at the equivalent amount in the year 2020. Comparing the three lines corresponding to median, maximum, and minimum over time, can you spot any interesting trends?
The wages_stats
and the DataFrames
and Plots
packages have been loaded for you with the using
keyword.
This exercise is part of the course
Data Manipulation in Julia
Exercise instructions
- Create a line plot of the median minimum wage over the years represented in the dataset and label it
median
. - To the same plot, add lines for maximum and minimum wages, with labels
max
andmin
, respectively. - Add a title "Trends in minimum wages in the US" to your plot.
- Label your x-axis
"Year"
and the y-axis"Inflation-adjusted Minimum Wage (USD)"
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Plot the median wage and label it
____(____, ____, ____)
# Plot the maximum and label it
____
# Plot the minimum and label it
____
# Add a title
____("Trends in minimum wages in the US")
# Add x and y labels
____("Year")
____("Inflation-adjusted Minimum Wage (USD)")