library(ggplot2)
# data comes from SurveyGizmo
df <- data.frame(
Strategy=c(
"Use an existing preset",
"Project fit",
"Default configurations",
"Pull Request discussions",
"Most used style within team",
"Minimal configurations",
"Effort of Enforcing a Rule",
"Consistent rules",
"Automatically generated",
"I never configured a linter"),
Participants=c(
70.2, 56.0, 51.1, 37.9, 33.0, 21.0, 19.1, 10.4, 7.4, 1.3)
)
pdf(file = "../../img/survey/rq2-strategies.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(Strategy, Participants), y=Participants)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", Participants)), vjust=0.5, size = rel(6.5)) +
scale_y_continuous(limits = c(0, 80)) +
theme(text = element_text(size = rel(5.5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
# data comes from SurveyGizmo
df <- data.frame(
Strategy=c(
"Use an existing preset",
"Project fit",
"Default configurations",
"Pull Request discussions",
"Most used style within team",
"Minimal configurations",
"Effort of enforcing a rule",
"Consistent rules",
"Automatically generated",
"I never configured a linter"),
Participants=c(
70.2, 56.0, 51.1, 37.9, 33.0, 21.0, 19.1, 10.4, 7.4, 1.3)
)
pdf(file = "../../img/survey/rq2-strategies.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(Strategy, Participants), y=Participants)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", Participants)), vjust=0.5, size = rel(6.5)) +
scale_y_continuous(limits = c(0, 80)) +
theme(text = element_text(size = rel(5.5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
# data comes from SurveyGizmo
df <- data.frame(
Frequency=c(
"Never",
"Very rare",
"Rare",
"Occasionally",
"Frequently",
"Very Frequently",
"N/A"),
Percentage=c(
22.8,27.8,22.4,19.3,2.7,1.9,3.1)
)
pdf(file = "../../img/survey/discussion-fp.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(Frequency, Percentage), y=Percentage)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", Percentage)), vjust=0.5, size = rel(5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
# data comes from SurveyGizmo
df <- data.frame(
Challenge=c(
"Agreeing on rules as a team",
"Creating and maintaining configurations",
"False positives",
"Enforcing rules",
"Enabling rules in existing projects",
"Too many warnings/errors",
"The lack of dynamic analysis",
"No challenges"),
Participants=c(
47, 38.3, 33.9, 33.6, 33.2, 29.2, 24.5, 8.4)
)
pdf(file = "../../img/survey/rq4-challenges.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(Challenge, Participants), y=Participants)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", Participants)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
# data comes from SurveyGizmo
df <- data.frame(
Frequency=c(
"Never",
"Very rare",
"Rare",
"Occasionally",
"Frequently",
"Very Frequently",
"N/A"),
Percentage=c(
22.8,27.8,22.4,19.3,2.7,1.9,3.1)
)
pdf(file = "../../img/survey/discussion-fp.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(Frequency, Percentage), y=Percentage)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", Percentage)), vjust=0.5, size = rel(5)) +
scale_y_continuous(limits = c(0, 40)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
participants <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
View(participants)
library(ggplot2)
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
bp<- ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity")
bp
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0)
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) +
geom_text(aes(y = value/3 + c(0, cumsum(value)[-length(value)]), label = percent(value/100)), size=5)
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) +
geom_text(aes(y = pct/3 + c(0, cumsum(pct)[-length(pct)]), label = percent(pct/100)), size=5)
library(scales)
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) +
geom_text(aes(y = pct/3 + c(0, cumsum(pct)[-length(pct)]), label = percent(pct/100)), size=5)
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) +
geom_text(aes(y = pct/3 + c(0, cumsum(pct)[-length(pct)]), label = percent(pct/100)), size=5) +
scale_fill_brewer("Blues") + blank_theme +
theme(axis.text.x=element_blank())+
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) +
geom_text(aes(y = pct/3 + c(0, cumsum(pct)[-length(pct)]), label = percent(pct/100)), size=5) +
scale_fill_brewer("Blues") + blank_theme +
theme(axis.text.x=element_blank())
blank_theme <- theme_minimal()+
theme(
axis.title.x = element_blank(),
axis.title.y = element_blank(),
panel.border = element_blank(),
panel.grid=element_blank(),
axis.ticks = element_blank(),
plot.title=element_text(size=14, face="bold")
)
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) +
geom_text(aes(y = pct/3 + c(0, cumsum(pct)[-length(pct)]), label = percent(pct/100)), size=5) +
scale_fill_brewer("Blues") + blank_theme +
theme(axis.text.x=element_blank())
ggplot(df, aes(x="", y=pct, fill=participant))+
geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) +
geom_text(aes(y = pct/3 + c(0, cumsum(pct)[-length(pct)]), label = percent(pct/100)), size=5) +
blank_theme +
theme(axis.text.x=element_blank())
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 90)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
source("/Users/mauricioaniche/workspace/likert/R/likert.R")
source("/Users/mauricioaniche/workspace/likert/R/label_wrap_mod.R")
source("/Users/mauricioaniche/workspace/likert/R/likert.options.R")
source("/Users/mauricioaniche/workspace/likert/R/abs_formatter.R")
source("/Users/mauricioaniche/workspace/likert/R/plot.likert.bar.R")
source("/Users/mauricioaniche/workspace/likert/R/likert.R")
source("/Users/mauricioaniche/workspace/likert/R/label_wrap_mod.R")
source("/Users/mauricioaniche/workspace/likert/R/likert.options.R")
source("/Users/mauricioaniche/workspace/likert/R/abs_formatter.R")
source("/Users/mauricioaniche/workspace/likert/R/plot.likert.bar.R")
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 90)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(country, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
pct = c(15, 268, 44, 10))
print(ggplot(data=df, aes(x=source, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
print(ggplot(data=df, aes(x=source, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=pct), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
print(ggplot(data=df, aes(x=source, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=pct), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
qty = c(15, 268, 44, 10))
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
qty = c(15, 268, 44, 10))
pdf(file = "../../img/survey/source.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(5.5)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
qty = c(15, 268, 44, 10))
pdf(file = "../../img/survey/source.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
qty = c(15, 268, 44, 10))
pdf(file = "../../img/survey/source.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(country, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
qty = c(15, 268, 44, 10))
pdf(file = "../../img/survey/source.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
qty = c(15, 268, 44, 10))
pdf(file = "../../img/survey/source.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank())) +
scale_x_discrete(limits = df$country)
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank())) +
scale_x_discrete(limits = df$country)
df$country
df$country <- factor(df$country, levels = df$country)
df$country
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank())) +
scale_x_discrete(limits = df$country)
reverse(df$country)
rev(df$country)
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
df$country <- factor(df$country, levels = rev(df$country))
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank())) +
scale_x_discrete(limits = df$country)
library(ggplot2)
library(scales)
# data from surveygizmo
df <- data.frame(
participant=c("Developer", "Team leader", "Student", "Manager", "Project manager", "Other", "Designer"),
pct = c(86.1, 6.3, 4.8, 1.2, 0.6, 0.6, 0.3))
pdf(file = "../../img/survey/role.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(participant, pct), y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 100)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
df <- data.frame(
country=c("United States", "Germany", "United Kingdom", "Canada", "Iceland", "Netherlands", "France", "All others"),
pct = c(38.4, 6.9, 6.3, 6, 4.2, 4.2, 3.3, 30.3))
df$country <- factor(df$country, levels = rev(df$country))
pdf(file = "../../img/survey/country.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=country, y=pct)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=sprintf("%1.1f%%", pct)), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 50)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank())) +
scale_x_discrete(limits = df$country)
dev.off()
df <- data.frame(
source=c("JS.is", "JS Reddit", "Echo JS", "Twitter"),
qty = c(15, 268, 44, 10))
pdf(file = "../../img/survey/source.pdf", width=8, height=5.2)
print(ggplot(data=df, aes(x=reorder(source, qty), y=qty)) +
geom_bar(stat="identity", fill="steelblue") + coord_flip() +
geom_text(aes(label=qty), vjust=0.5, size = rel(6)) +
scale_y_continuous(limits = c(0, 300)) +
theme(text = element_text(size = rel(5)), axis.title.x=element_blank(), axis.title.y=element_blank()))
dev.off()
