Graph 1

genderdata$order <- factor(genderdata$legend, c("Don't Know", "Not At All Common", "Not Very Common", "Fairly Common", "Very Common"))
ggplot(genderdata,
       aes(x = legend,
           y = count,
           fill = gender)) + 
  geom_bar(stat="identity") + 
  facet_wrap(~category) +
  labs(title = "Perceptions of domestic violence and sexual harassment 
       prevalence among men and women in the UK",
       theme(plot.title = element_text(hjust = 0.5)), 
       x = "Perceptions of prevalence", 
       y = "Number of people") +
  scale_x_discrete(name ="Perceptions of prevalence", 
limits=c("Don't Know", "Not At All Common", "Not Very Common", "Fairly Common", "Very Common")) +
  coord_flip() 

I have made a stacked bar chart graphing the relationship between responses to the question ‘In general, how common do you think that domestic violence is in the UK?’ and responses to an identical question in the Eurobarometer survey asked in relation to sexual harassment. I have also graphed how both questions’ responses are related to gender of respondent.

I graphed this relationship because I was interested firstly in differing perceptions about the prevalence of domestic violence and sexual harassment respectively and what differences – if any – existed about their perceived prevalence among the respondents. Second, I was interested in comparing whether people’s responses tended to change according to gender.

I chose to use a bar chart as my geometry as I wanted to display a specific categorical variable and show the number of occurrences between groups within that variable. I decided to display the bars horizontally as it made the labels for each bar easier to read. I chose to use the default gradient color scheme as I felt that it effectively conveyed the two values I was comparing – female and male – with sufficient contrast. I centered the text for the title and spread it across two lines.

Graph 2

genderdata2$Political_View[genderdata2$Political_View>=97]<- NA
ggplot(genderdata2, 
    aes(x = Perception, 
        y = Political_View)) +
  geom_jitter(color = 'darkseagreen3') +
labs(title = "Relationship between perceptions of domestic violence prevalence among 
men and women in the UK and where they place their political views",
     theme(plot.title = element_text(hjust = 0, face = "bold")), 
     subtitle = "The 1306 survey respondents were asked to place their political views on a spectrum from 
1 ('the left') to 10 ('the right').",
     theme(plot.subtitle = element_text(hjust = 0)),
     caption = "Data source: Eurobarometer 85.3, European Commission (June 2016)",
     theme(plot.caption = element_text(hjust = 0)), 
     x = "Perceptions of prevalence", 
     y = "Where people place their political views") + 
scale_x_discrete(name ="Perceptions of prevalence", 
limits=c("Very Common","Fairly Common","Not Very Common", "Not At All Common", "Don't Know")) +
  theme_light()

For my second graph, I made a jitter plot graphing the relationship between the perceptions of domestic violence prevalence among the male and female UK survey respondents who answered the Eurobarometer survey and their political views.

I graphed this relationship because I was interested to see if I would find any correlations between where people placed their political views on a spectrum from 1 to 10 (with 1 being “the left” and 10 being “the right”) and how prevalent or not they perceived domestic violence to be. I was also keen to make a graph using ggplot2 which compared two continuous variables and therefore obtained raw data from the Leibniz Institute, which developed the Eurobarometer survey, to be able to compare a large number of individual survey answers.

I initially tried to use a scatter plot as my geometry, thinking this would best showcase how well correlated the two continuous variables I wanted to examine were. However, I found that a jitter plot was better suited to my particular dataset to avoid the many overlapping points appearing as a single dot and to better showcase the totality of my data. I adjusted the color of the points from black to a dark sea green, which I found attractive without being obtrusive. I also modified the theme of the graph to make the lines and axes lighter and therefore direct more attention to the data. Finally, I changed the format of the title so it was left aligned and bold and added a subtitle underneath the title which explained how the respondents’ political views were interpreted, as I feared that would not otherwise be clear from the graph.

Graph 3

genderdatagraph3 = read.csv(file = 'genderdatagraph3.csv', header = TRUE, fileEncoding="UTF-8-BOM")
pie <- ggplot(genderdatagraph3, 
              aes(x = "", y = Count, fill = Family_Friends)) +
  geom_bar(width = 1, stat = "identity", color = "white") +
  labs(fill="Responses",
       x=NULL,
       y=NULL,
title="Respondents who know a victim of domestic violence in their 
circle of friends and family.", 
       caption = "Data source: Eurobarometer, 85.3, European Commission (June 2016)")

pie + coord_polar(theta = "y", start=0) + 
  theme_void()

My final graph is a pie chart which sets out the proportion of the survey respondents who answered that they did or did not know any men and/or women who were victims of domestic violence among their “circle of friends and family”.

I decided to graph this relationship because I was interested to know whether it was common for respondents to report knowing a victim of domestic violence, how frequently this was a woman rather than a man and whether respondents sometimes reported knowing both male and female victims among their immediate circle of friends and family members.

I had not previously made a pie chart in R during our class time and chose to do it for this assignment as a personal challenge to try a new type of visualization. The pie chart is an effective graph for the type of relationship I am graphing – specifically the categorical composition of the respondents – but I found adding extra formatting to the graph very challenging. I tried to change the color palette of the pie chart by adding the line pie + scale_fill_brewer(palette=“Blues”)+ theme_minimal() to my code, but, despite many attempts, I could not get this specific code to run successfully. I had also wanted to add labels for each specific slice of the pie chart setting out its respective percentage proportion using the code label = percent(value/100)), size=5). However, I also found this presented complications when running the code. I therefore decided to settle with adding thin white lines between each slice and using bright colors to effectively distinguish each individual response as presented on the graph.