File:DonValleyGraph.png
Size of this preview: 800 × 440 pixels. Other resolutions: 320 × 176 pixels | 640 × 352 pixels | 944 × 519 pixels.
Original file (944 × 519 pixels, file size: 106 KB, MIME type: image/png)
File information
Structured data
Captions
Contents
Summary
editDescriptionDonValleyGraph.png |
English: United Kingdom general election results for Don Valley constituency from its creation in 1918 to 2005. © Jeremy Atherton 2005. |
Date | 21 December 2005 (original upload date) |
Source | Transferred from en.wikipedia to Commons by Sreejithk2000 using CommonsHelper. |
Author | JeremyA at English Wikipedia |
File:DonValleyGraph.svg is a vector version of this file. It should be used in place of this PNG file when not inferior.
File:DonValleyGraph.png → File:DonValleyGraph.svg
For more information, see Help:SVG.
|
Notes
editThe Background colour indicates the party of the sitting MP at any given year. From 1918 to 1922 the seat was held by the National Democratic Party
Graph drawn with R
Statistics gathered from:
- http://www.psr.keele.ac.uk/area/uk/edates.htm archive copy at the Wayback Machine
Parties:
- Conservative = Conservative Party
- Labour = Labour Party
- Liberal = Liberal Party (1918–1979); SDP-Liberal Alliance (1983–1987); Liberal Democrats (1992–present).
Data used:
Year | Conservative | Labour | Liberal | UKIP | Other |
---|---|---|---|---|---|
1918.95 | 24.5 | 29.3 | 46.2 | ||
1922.87 | 47 | 25.4 | 27.6 | ||
1923.93 | 39.6 | 60.4 | |||
1924.8 | 46.1 | 53.9 | |||
1929.41 | 26.7 | 73.3 | |||
1931.82 | 41.4 | 58.6 | |||
1935.87 | 31.1 | 68.9 | |||
1945.51 | 28.3 | 71.1 | |||
1950.148 | 24.6 | 75.4 | |||
1951.9 | 25.9 | 74.1 | |||
1955.5 | 26.3 | 73.7 | |||
1959.83 | 29.1 | 70.9 | |||
1964.83 | 28.1 | 71.9 | |||
1966.33 | 25.1 | 74.9 | |||
1970.5 | 30.5 | 69.5 | |||
1974.25 | 29.9 | 70.1 | |||
1974.86 | 21.2 | 63.3 | 15.6 | ||
1979.42 | 31.2 | 55.6 | 11.6 | 1.6 | |
1983.5 | 32.4 | 45.1 | 22.5 | ||
1987.5 | 32.3 | 53.1 | 11.9 | ||
1992.33 | 31.7 | 55 | 11.9 | 1.4 | |
1997.42 | 24.6 | 58.3 | 9.7 | 7.5 | |
2001.5 | 28.6 | 54.6 | 11.2 | 2.1 | 3.5 |
2005.42 | 29.4 | 52.7 | 18 | ||
2010.35 | 29.7 | 37.9 | 17.1 | 4.4 | 10.9 |
2015.35 | 25.3 | 46.2 | 3.5 | 23.5 | 1.6 |
2017.44 | 41.7 | 53 | 1.9 | 3.5 |
Code:
The following R code will reproduce the graph using the data on this page.
library(tidyverse)
library(htmltab)
don <- as.tibble(htmltab("https://commons.wikimedia.org/wiki/File:DonValleyGraph.png",2, rm_nodata_cols = F))
tidy_don <- gather(don, "Party", "Votes", 2:6)
tidy_don$Year <- as.numeric(tidy_don$Year)
tidy_don$Party <- factor(tidy_don$Party, levels = c("Conservative", "Labour", "Liberal", "Green", "SNP", "UKIP", "Other"))
tidy_don$Votes <- as.numeric(tidy_don$Votes)
party_colours <- c("#0087DC", "#DC241F", "#FAA61A", "#008066", "#FFF95D", "#EFE600", "dark grey")
names(party_colours) <- c("Conservative", "Labour", "Liberal", "Green", "SNP", "UKIP", "Other")
don_victor <- tidy_don %>% filter(is.na(Votes) == FALSE) %>% group_by(Year) %>% summarize(Party = Party[which(Votes == max(Votes))])
don_victor$start_year <- don_victor$Year
don_victor$end_year <- c(don_victor$Year[-1], 2019)
don_victor[1,3] <- floor(don_victor[1,3]-1)
start_year <- don_victor[[1,3]]
end_year <- 2019
ggplot(tidy_don) +
geom_rect(data = don_victor,
aes(xmin = start_year,xmax = end_year, ymin = -Inf, ymax = Inf, fill = Party),
alpha = 0.35,
show.legend = F) +
geom_line(aes(x = Year, y = Votes, colour = Party), size = 0.703) +
geom_point(aes(x = Year, y = Votes, colour = Party)) +
geom_hline(yintercept = 100, color="black", size = 1.5) +
geom_vline(xintercept = 2019, color="black", size = 1.5) +
scale_colour_manual(values = party_colours, labels = c("Conservative", "Labour", "Liberal", "UKIP", "Other")) +
scale_fill_manual(values = party_colours) +
theme(text = element_text(color="black", size = 14),
axis.text = element_text(color="black", size = 11),
axis.line.x = element_line(color="black", size = 0.703),
axis.ticks.x = element_line(color="black", size = 0.703),
axis.line.y = element_line(color="black", size = 0.703),
axis.ticks.y = element_line(color="black", size = 0.703),
axis.ticks.length = unit(5, "points"),
panel.grid.major = element_line(color="blue", size = 0.5, linetype = 3),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
legend.position = c(.99, .98),
legend.text = element_text(color="black", size = 11),
legend.title=element_blank(),
legend.justification = c("right", "top"),
legend.box.just = "right",
legend.key = element_blank(),
legend.background = element_rect(fill = "white", colour = "black"),
legend.margin = margin(0, 4, 4, 4)) +
scale_x_continuous(expand = c(0, 0), limits = c(start_year, end_year), breaks = seq(1890, 2010, 10)) +
scale_y_continuous(expand = c(0, 0), limits = c(0, 100), breaks = seq(0, 100, 20)) +
labs(x = "Year", y = "Percentage Vote")
ggsave("DonGraph.png", device = "png", units = "cm", width = 20, height = 11, dpi = 120)
Licensing
editJeremyA at the English-language Wikipedia, the copyright holder of this work, hereby publishes it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license. Subject to disclaimers. | ||
Attribution: JeremyA at the English-language Wikipedia | ||
| ||
This licensing tag was added to this file as part of the GFDL licensing update.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue |
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. Subject to disclaimers.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
Original upload log
editThe original description page was here. All following user names refer to en.wikipedia.
- 2010-05-08 19:54 JeremyA 945×520× (61414 bytes)
- 2005-12-21 03:37 JeremyA 945×520× (20568 bytes) United Kingdom general election results for [[Don Valley (UK Parliament constituency)|Don Valley]] constituency from its creation in 1918 to 2005. © Jeremy Atherton 2005. ==Notes== The Background colour indicates the party of the sitti
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 15:33, 13 June 2017 | 944 × 519 (106 KB) | JeremyA (talk | contribs) | Update data. | |
06:22, 3 June 2010 | 945 × 520 (60 KB) | File Upload Bot (Magnus Manske) (talk | contribs) | {{BotMoveToCommons|en.wikipedia|year={{subst:CURRENTYEAR}}|month={{subst:CURRENTMONTHNAME}}|day={{subst:CURRENTDAY}}}} {{Information |Description={{en|United Kingdom general election results for Don Valley |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.