Jump to content

File:DonValleyGraph.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: 106 KB, MIME type: image/png)

Summary

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

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

Notes

The 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:

Parties:

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

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

The 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

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

21 December 2005

File history

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

Date/TimeThumbnailDimensionsUserComment
current15:33, 13 June 2017Thumbnail for version as of 15:33, 13 June 2017944 × 519 (106 KB)JeremyAUpdate data.
06:22, 3 June 2010Thumbnail for version as of 06:22, 3 June 2010945 × 520 (60 KB)File Upload Bot (Magnus Manske) {{BotMoveToCommons|en.wikipedia|year={{subst:CURRENTYEAR}}|month={{subst:CURRENTMONTHNAME}}|day={{subst:CURRENTDAY}}}} {{Information |Description={{en|United Kingdom general election results for Don Valley
No pages on the English Wikipedia use this file (pages on other projects are not listed).