File:RotherValleyGraph.png

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file(944 × 519 pixels, file size: 103 KB, MIME type: image/png)

Summary

Description
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.

In other languages
Alemannisch  Bahasa Indonesia  Bahasa Melayu  British English  català  čeština  dansk  Deutsch  eesti  English  español  Esperanto  euskara  français  Frysk  galego  hrvatski  Ido  italiano  lietuvių  magyar  Nederlands  norsk bokmål  norsk nynorsk  occitan  Plattdüütsch  polski  português  português do Brasil  română  Scots  sicilianu  slovenčina  slovenščina  suomi  svenska  Tiếng Việt  Türkçe  vèneto  Ελληνικά  беларуская (тарашкевіца)  български  македонски  нохчийн  русский  српски / srpski  татарча/tatarça  українська  ქართული  հայերեն  বাংলা  தமிழ்  മലയാളം  ไทย  한국어  日本語  简体中文  繁體中文  עברית  العربية  فارسی  +/−
New SVG image

Notes

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:

Parties:

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

JeremyA at the English-language Wikipedia, the copyright holder of this work, hereby publishes it under the following license:
w:en:Creative Commons
attribution share alike
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
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
This licensing tag was added to this file as part of the GFDL licensing update.
GNU head 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.

Original upload log

Transferred from en.wikipedia to Commons using For the Common Good.

The original description page was here. All following user names refer to en.wikipedia.
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)

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

3 September 2005

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current01:49, 14 June 2017Thumbnail for version as of 01:49, 14 June 2017944 × 519 (103 KB)JeremyAupdated
01:14, 9 May 2015Thumbnail for version as of 01:14, 9 May 2015945 × 520 (60 KB)JeremyAupdate with 2105 results
02:33, 5 April 2013Thumbnail for version as of 02:33, 5 April 2013945 × 520 (59 KB)OgreBot(BOT): Reverting to most recent version before archival
02:33, 5 April 2013Thumbnail for version as of 02:33, 5 April 2013945 × 520 (19 KB)OgreBot(BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2005-12-20 04:50:11 by JeremyA
02:33, 5 April 2013Thumbnail for version as of 02:33, 5 April 2013589 × 337 (9 KB)OgreBot(BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2005-09-05 20:16:29 by JeremyA
02:33, 5 April 2013Thumbnail for version as of 02:33, 5 April 2013589 × 337 (9 KB)OgreBot(BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2005-09-03 15:37:41 by JeremyA
11:43, 4 April 2013Thumbnail for version as of 11:43, 4 April 2013945 × 520 (59 KB)Vacation9Transferred from en.wikipedia: see original upload log above
The following pages on the English Wikipedia use this file (pages on other projects are not listed):