From 945efe1dea0d7262c7f3401b5029ab2be67b028c Mon Sep 17 00:00:00 2001 From: Jeremy Kidwell Date: Fri, 1 Feb 2019 13:29:18 +0000 Subject: [PATCH] fixed legends on choropleth and lines --- mapping_draft.Rmd | 25 ++++++++++++------------- mapping_draft.html | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/mapping_draft.Rmd b/mapping_draft.Rmd index 7cef8e3..b27ea57 100644 --- a/mapping_draft.Rmd +++ b/mapping_draft.Rmd @@ -341,7 +341,6 @@ ggplot() + "Data: UK Data Service (OGL) & Jeremy H. Kidwell", "You may redistribute this graphic under the terms of the CC-by-SA 4.0 license.", sep = "\n")) + - guides(colour = guide_legend(reverse=T)) + theme_void() + theme(text = element_text(family = "Arial Narrow", size = 9), plot.title = element_text(size = 12, face = "bold"), @@ -363,7 +362,7 @@ ggplot() + data = admin_lev1_fortified, colour = 'black', alpha = .7, - size = .1) + + size = .005) + viridis::scale_fill_viridis(discrete = TRUE) + labs(x = NULL, y = NULL, fill = "Groups", title = "Figure 2", @@ -378,7 +377,7 @@ ggplot() + plot.margin = unit(c(0, 0.25, 0.0, 0.25), "in"), panel.border = element_rect(fill = NA, colour = "#cccccc"), legend.text = element_text(size = 8), - legend.position = c(0.9, 0.25)) + legend.position = c(0.25, 0.85)) # ggsave("figure2.pdf") # TODO: Need to sort out why error: "Insufficient data values to produce 5 bins." @@ -389,7 +388,7 @@ ggplot() + data = admin_lev1_fortified, colour = 'black', alpha = .7, - size = .3) + + size = .005) + viridis::scale_fill_viridis(discrete = TRUE) + labs(x = NULL, y = NULL, fill = "Groups", title = "Figure 3", @@ -404,7 +403,7 @@ ggplot() + plot.margin = unit(c(0, 0.25, 0.0, 0.25), "in"), panel.border = element_rect(fill = NA, colour = "#cccccc"), legend.text = element_text(size = 8), - legend.position = c(0.9, 0.25)) + legend.position = c(0.25, 0.85)) # ggsave("figure3.pdf") ``` @@ -461,7 +460,7 @@ ggplot() + data = admin_lev1_fortified, colour = 'black', alpha = .7, - size = .3) + + size = .005) + viridis::scale_fill_viridis(discrete = TRUE) + labs(x = NULL, y = NULL, fill = "Groups", title = "Figure 5", @@ -476,7 +475,7 @@ ggplot() + plot.margin = unit(c(0, 0.25, 0.0, 0.25), "in"), panel.border = element_rect(fill = NA, colour = "#cccccc"), legend.text = element_text(size = 8), - legend.position = c(0.9, 0.25)) + legend.position = c(0.25, 0.85)) ggplot() + @@ -485,7 +484,7 @@ ggplot() + data = admin_lev1_fortified, colour = 'black', alpha = .7, - size = .3) + + size = .005) + viridis::scale_fill_viridis(discrete = TRUE) + labs(x = NULL, y = NULL, fill = "Groups", title = "Figure 6", @@ -500,7 +499,7 @@ ggplot() + plot.margin = unit(c(0, 0.25, 0.0, 0.25), "in"), panel.border = element_rect(fill = NA, colour = "#cccccc"), legend.text = element_text(size = 8), - legend.position = c(0.9, 0.25)) + legend.position = c(0.25, 0.85)) ggplot() + geom_polygon(aes(x = long, y = lat, group = group, @@ -508,7 +507,7 @@ ggplot() + data = admin_lev1_fortified, colour = 'black', alpha = .7, - size = .3) + + size = .005) + viridis::scale_fill_viridis(discrete = TRUE) + labs(x = NULL, y = NULL, fill = "Groups", title = "Figure 7", @@ -523,7 +522,7 @@ ggplot() + plot.margin = unit(c(0, 0.25, 0.0, 0.25), "in"), panel.border = element_rect(fill = NA, colour = "#cccccc"), legend.text = element_text(size = 8), - legend.position = c(0.9, 0.25)) + legend.position = c(0.25, 0.85)) # todo: plot as animated chorogram: # https://www.r-graph-gallery.com/331-basic-cartogram/ @@ -634,7 +633,7 @@ ggplot() + data = urbanrural_fortified, colour = 'black', alpha = .7, - size = .3) + + size = .005) + geom_point(aes(X, Y, fill = NULL, group = NULL), size = 1, data=ecs_df, colour = 'white', size = .3, @@ -653,7 +652,7 @@ ggplot() + plot.margin = unit(c(0, 0.25, 0.0, 0.25), "in"), panel.border = element_rect(fill = NA, colour = "#cccccc"), legend.text = element_text(size = 8), - legend.position = c(0.9, 0.25)) + legend.position = c(0.25, 0.85)) ``` diff --git a/mapping_draft.html b/mapping_draft.html index 1753680..08dc47e 100644 --- a/mapping_draft.html +++ b/mapping_draft.html @@ -361,7 +361,7 @@ $(document).ready(function () { ## Source: "/Users/kidwellj/OneDrive - bham.ac.uk/writing/201708_mapping_environmental_action/data", layer: "sc_dz_11" ## with 6976 features ## It has 9 fields -

+

Another crucial point of assessment relates to the relation of Eco-Congregation communities to the Scottish Index of Multiple Deprivation. This instrument aggregates a large variety of factors which can lead to deprivation including crime rates, employment levels, access to services (implicating remoteness), and literacy. By assessing ECS, Transition, and dtas against the deprivation scale, we can assess whether eco-congregations fall within particular demographics and also whether the fully aggregated SIMD measurement provides a useful point of comparison for our purposes. The SIMD essentially divides Scotland into 6407 geographic zones and then ranks them based on their relative deprivation. This data set can be split into any number of groups, but for our purposes we have settled on Quintiles, splitting the SIMD data set at every 1302 entries. We then measured where each transition group, ECS, and dtas fell within these zones and calculated how they fell into these five quintiles, from more to least deprived.

The first, and most compelling finding is that, in general Eco-Congregation Scotland and Transition Scotland are both roughly the same and match the level of population distribution in the lowest quintile of the general SIMD measurement. 8% of transition groups and eco-congregation groups which have received awards and 9% of the population are located within this quintile. However, taken in relation to the distribution of places of worship in the lowest quintile, we find that eco-congregations are located at half the rate that places of worship are (15%) and dtass match this much more closely at 14%. Turning towards the top quintile, this pattern also holds, here both transition groups (21%) and eco-congregations (21% and 29% of awarded congregations) depart from the population distribution in this upper quintile (which is 10%). Again, general places of worship (at 11%) and DTASs (at 5%) take the opposite direction. We can say decisively that in communities which have been identified as good candidates for intervention to reduce deprivation, ECS and Transition are less likely, and they are over-represented at the areas which fall into the least deprived quintile.

We can find divergence between transition communities and eco-congregation when we split out SIMD domains. In the lowest quartile, measuring exclusively for the income domain, ECS is more represented (11%) - roughly the same as DTAS (12%), and transition is less (6%) represented. In general (as shown on the chart in Appendix D), these trends hold when representation of our groups are measured within other non-remoteness domains of the SIMD. Our basic conclusion is that transition towns are least likely to operate within the lowest quartile of SIMD and DTASs are most likely, with ECS somewhere in the middle. Given the general disparity against the presence of places of worship, it seems fair to suggest that this might be an area for improvement, perhaps even worth developing a special programme which might target areas in SIMD quartile 1 for eco-congregation outreach. This might be considered particularly in light of the starkest underrepresentation of ECS and transition within the SIMD domain of education, skills, and training.