File:RotherValleyGraph.png
Original file (944 × 519 pixels, file size: 103 KB, MIME type: image/png)
Captions
Contents
Summary
[edit]DescriptionRotherValleyGraph.png |
English: United Kingdom general election results for Rother Valley constituency from its creation in 1918 to 2005. © Jeremy Atherton 2005. |
Date | 3 September 2005 (original upload date) |
Source | Own work |
Author | User:JeremyA |
File:RotherValleyGraph.svg is a vector version of this file. It should be used in place of this PNG file when not inferior.
File:RotherValleyGraph.png → File:RotherValleyGraph.svg
For more information, see Help:SVG.
|
Notes
[edit]The Background colour indicates the party of the sitting MP at any given year.
The election held in 1922 does not appear on this graph. Only one candidate stood at this election and so no votes were cast, the labour candidate being elected unopposed. A dashed line indicates the missing elections.
Graph drawn with R
Statistics gathered from:
- http://www.psr.keele.ac.uk/area/uk/edates.htm archive copy at the Wayback Machine
- http://news.bbc.co.uk/hi/english/static/vote2001/results_constituencies/constituencies/488.stm
- http://news.bbc.co.uk/1/shared/vote2005/html/488.stm
Parties:
- Conservative = Conservative and Liberal Unionist (1951–1959); Conservative Party (UK) (1964–present).
- Labour = Labour Party (UK)
- Liberal = Liberal Party (UK) (1974–1979); SDP-Liberal Alliance (1983–1987); Liberal Democrats (UK) (1992–present).
Data used:
Year | Conservative | Labour | Liberal | UKIP | Other |
---|---|---|---|---|---|
1918.95 | 55.1 | 17.7 | 27.2 | ||
1922.87 | |||||
1923.93 | 31.4 | 68.6 | |||
1924.8 | 34.7 | 65.3 | |||
1929.41 | 23.7 | 76.3 | |||
1931.82 | 37.7 | 62.3 | |||
1935.87 | 28 | 72 | |||
1945.51 | 24.8 | 75.2 | |||
1950.148 | 23.4 | 76.6 | |||
1951.9 | 24.29 | 75.71 | |||
1955.5 | 24.42 | 75.58 | |||
1959.83 | 25.9 | 74.1 | |||
1964.83 | 25.58 | 74.42 | |||
1966.33 | 23.18 | 76.82 | |||
1970.5 | 28.21 | 71.79 | |||
1974.25 | 26.62 | 73.38 | |||
1974.86 | 17.91 | 67.28 | 14.8 | ||
1979.42 | 27.04 | 62.22 | 10.74 | ||
1983.5 | 28.09 | 46.5 | 25.41 | ||
1987.5 | 24.91 | 56.38 | 18.41 | 0.29 | |
1992.33 | 26.86 | 60.48 | 12.66 | ||
1997.42 | 16.68 | 67.56 | 11.57 | 4.19 | |
2001.5 | 21.7 | 62.1 | 12.5 | 3.7 | |
2005.42 | 19.4 | 55.4 | 15.9 | 4.3 | 5.1 |
2010.35 | 28.2 | 40.9 | 17.3 | 5.6 | 7.7 |
2015.35 | 23.3 | 43.6 | 4.2 | 28.1 | 0.8 |
2017.44 | 40.3 | 48.1 | 2.3 | 7.5 | 1.8 |
Code:
The graph was produced with R. The following code will reproduce the graph using the data on this page.
library(tidyverse)
library(htmltab)
election_graph <- function(pageURL) {
election <- htmltab(pageURL,
which = 2,
rm_nodata_cols = F)
election <- as.tibble(lapply(election, function(x) {gsub("unopp", "100", x)}))
tidy_election <- gather(election, "Party", "Votes", 2:length(election))
tidy_election$Year <- as.numeric(tidy_election$Year)
tidy_election$Party <- factor(tidy_election$Party, levels = c("Conservative", "Labour", "Liberal", "Green", "SNP", "UKIP", "Other"))
tidy_election$Votes <- as.numeric(tidy_election$Votes)
election_victor <- tidy_election %>% filter(is.na(Votes) == FALSE) %>% group_by(Year) %>% summarize(Party = Party[which(Votes == max(Votes))])
election_victor$Year <- as.numeric(election_victor$Year)
election_victor$start_year <- election_victor$Year
election_victor$end_year <- c(election_victor$Year[-1], ceiling(election_victor$Year[length(election_victor$Year)] + 1))
election_victor[1,3] <- floor(election_victor[1,3] - 1)
tidy_election$Votes <- as.numeric(sapply(tidy_election$Votes, function(x) {gsub(100, NA, x)}))
party_colours <- c("#0087DC", "#DC241F", "#FAA61A", "#008066", "#FFF95D", "#EFE600", "dark grey")
names(party_colours) <- c("Conservative", "Labour", "Liberal", "Green", "SNP", "UKIP", "Other")
ggplot(tidy_election) +
geom_rect(data = election_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) +
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(.98, .97),
legend.direction = "horizontal",
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(election_victor[[1,3]], election_victor$end_year[length(election_victor$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")
}
election_graph("https://commons.wikimedia.org/wiki/File:RotherValleyGraph.png")
ggsave("RotherValleyGraph.png", device = "png", units = "cm", width = 20, height = 11, dpi = 120)
Licensing
[edit]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
[edit]Transferred from en.wikipedia to Commons using For the Common Good.
Date/Time | Dimensions | User | Comment |
---|---|---|---|
19:50, 8 May 2010 | 945 × 520 (59,907 bytes) | w:en:JeremyA (talk | contribs) | () |
04:50, 20 December 2005 | 945 × 520 (19,532 bytes) | w:en:JeremyA (talk | contribs) | (Extend back to 1918) |
20:16, 5 September 2005 | 589 × 337 (9,278 bytes) | w:en:JeremyA (talk | contribs) | (Update party colours to better reflect those used elsewhere on wikipedia) |
15:37, 3 September 2005 | 589 × 337 (9,288 bytes) | w:en:JeremyA (talk | contribs) | (Rother Valley election results) |
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 01:49, 14 June 2017 | 944 × 519 (103 KB) | JeremyA (talk | contribs) | updated | |
01:14, 9 May 2015 | 945 × 520 (60 KB) | JeremyA (talk | contribs) | update with 2105 results | ||
02:33, 5 April 2013 | 945 × 520 (59 KB) | OgreBot (talk | contribs) | (BOT): Reverting to most recent version before archival | ||
02:33, 5 April 2013 | 945 × 520 (19 KB) | OgreBot (talk | contribs) | (BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2005-12-20 04:50:11 by JeremyA | ||
02:33, 5 April 2013 | 589 × 337 (9 KB) | OgreBot (talk | contribs) | (BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2005-09-05 20:16:29 by JeremyA | ||
02:33, 5 April 2013 | 589 × 337 (9 KB) | OgreBot (talk | contribs) | (BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2005-09-03 15:37:41 by JeremyA | ||
11:43, 4 April 2013 | 945 × 520 (59 KB) | Vacation9 (talk | contribs) | Transferred from en.wikipedia: see original upload log above |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org