The following is the chart as made by William Playfair, showing at one view the price of both the quarter of wheat and wages of labour by the Week, from 1565 to 1821.
The following is the chart as made by William Playfair, showing at one view the price of both the quarter of wheat (=12.70058636 kg) and wages of labor by the Week, from 1565 to 1821.
)*](img/playfair-chart.png)
...
...
@@ -38,6 +38,7 @@ library(Hmisc)
```{r, results=FALSE, message=FALSE}
library(tidyverse)
library(ggplot2)
library(dplyr)
```
2. Building the data frame:
...
...
@@ -70,18 +71,17 @@ my_colors <- list( blue = "#3399e6",
First, we represent the data as simple dots for both wages and wheat price.
As it is difficult to see the pattern for the wheat values evolution, we use the `stat_smooth()` function that shows a smoothed mean (with a confidence level of 70%).
As it is difficult to see the overall pattern for the wheat values evolution, we use the `stat_smooth()` function that shows a smoothed mean (with a confidence level of 70%).
We try to make the two curves occupy the largest space as possible, all by avoiding them intersect, in order to facilitate the reading of the plot. For that purpose, my change reduce the scale of Wheat price by 2/3.
```{r, message=FALSE}
# Set color parameters:
wages_color <- "#ff5733"
...
...
@@ -109,43 +111,58 @@ ggplot(df, aes(x=Year)) +
geom_line( aes(y=Wheat/1.5), size = 0.3, color = wheat_color, linetype="dashed") +
## Another representation without an explicit time axis
When simply plotting `Wages = f(Wheat)`, there is a high density of samples that are grouped around the lower values of Wages (compared to higher values), which makes it very hard to read the graph. As a solution, we propose the following representation, on which we defined two domains of wage value, each with a different x-axis scale.
Moreover, the evolution of time (Year) is now represented with a nuanced blue color.