I am analyzing a population movement pattern and I would like to design a visualization like this one:
Is there any tool or language (preferably R) I can use for that purpose?
Here is a sample of my dataset.
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.
Sign up to join this communityI am analyzing a population movement pattern and I would like to design a visualization like this one:
Is there any tool or language (preferably R) I can use for that purpose?
Here is a sample of my dataset.
Of course you can reproduce that graph with some ggplot
!
Here is the code to create it:
library(ggplot2)
library(scales)
df <- read.csv2('Graphs_SK.csv')
p <- ggplot(data = df, aes(x = Governorate)) +
geom_segment(aes(y = Mid.May.2015, yend = Dec.16, xend = Governorate),
color = 'grey', size = 1) +
geom_point(aes(y = Mid.May.2015, color = 'start'), size = 2) +
geom_point(aes(y = Dec.16, color = 'end'), size = 2) +
scale_colour_manual(name = '(Population in millions)',
labels = c('May 2015', 'Dec 2016'),
values = c('start' = 'steelblue4', 'end' = 'steelblue')) +
scale_y_continuous(labels = comma, name = '', position = 'top') +
coord_flip() +
ggtitle('1 Year of something of Governorate') +
guides(colour = guide_legend(title.position = 'right')) +
theme(panel.background = element_rect(fill = 'white'),
legend.position = c(-.15, 1.03),
legend.direction = 'horizontal',
legend.justification = c(0, 0),
legend.key = element_rect(fill = NA),
legend.title = element_text(size = 10),
axis.text.y = element_text(hjust = 0),
axis.ticks.y = element_line(size = NA),
plot.title = element_text(hjust = .5))
Gantt chart is what you need. There're numbers of visualization libraries which supports gantt chart.
Checkout this post: https://stackoverflow.com/questions/3550341/gantt-charts-with-r