Skip to content

Instantly share code, notes, and snippets.

@jalapic
Created October 3, 2015 01:27
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jalapic/9a1c069aa8cee4089c1e to your computer and use it in GitHub Desktop.
Save jalapic/9a1c069aa8cee4089c1e to your computer and use it in GitHub Desktop.
Australian Schizophrenia Births
### Example Viridis Plot
library(ggplot2)
library(viridis)
library(season)
library(gridExtra)
pa<-ggplot(schz, aes(year, month, fill = SczBroad)) +
geom_tile(colour="gray20", size=1.5, stat="identity") +
scale_fill_viridis(option="A") +
scale_y_continuous(breaks=1:12, labels=month.abb[1:12])+
xlab("") +
ylab("") +
ggtitle("Total Australian Schizophrenics Born By Month and Year") +
theme(
plot.title = element_text(color="white",hjust=0,vjust=1, size=rel(2)),
plot.background = element_rect(fill="gray20"),
panel.background = element_rect(fill="gray20"),
panel.border = element_rect(fill=NA,color="gray20", size=0.5, linetype="solid"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
axis.text = element_text(color="white", size=rel(1.5)),
axis.text.y = element_text(hjust=1),
legend.text = element_text(color="white", size=rel(1.3)),
legend.background = element_rect(fill="gray20"),
legend.position = "bottom",
legend.title=element_blank()
)
pb<-ggplot(schz, aes(year, month, fill = SczBroad)) +
geom_tile(colour="gray20", size=1.5, stat="identity") +
scale_fill_viridis(option="B") +
scale_y_continuous(breaks=1:12, labels=month.abb[1:12])+
xlab("") +
ylab("") +
ggtitle("Total Australian Schizophrenics Born By Month and Year") +
theme(
plot.title = element_text(color="white",hjust=0,vjust=1, size=rel(2)),
plot.background = element_rect(fill="gray20"),
panel.background = element_rect(fill="gray20"),
panel.border = element_rect(fill=NA,color="gray20", size=0.5, linetype="solid"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
axis.text = element_text(color="white", size=rel(1.5)),
axis.text.y = element_text(hjust=1),
legend.text = element_text(color="white", size=rel(1.3)),
legend.background = element_rect(fill="gray20"),
legend.position = "bottom",
legend.title=element_blank()
)
pc<-ggplot(schz, aes(year, month, fill = SczBroad)) +
geom_tile(colour="gray20", size=1.5, stat="identity") +
scale_fill_viridis(option="C") +
scale_y_continuous(breaks=1:12, labels=month.abb[1:12])+
xlab("") +
ylab("") +
ggtitle("Total Australian Schizophrenics Born By Month and Year") +
theme(
plot.title = element_text(color="white",hjust=0,vjust=1, size=rel(2)),
plot.background = element_rect(fill="gray20"),
panel.background = element_rect(fill="gray20"),
panel.border = element_rect(fill=NA,color="gray20", size=0.5, linetype="solid"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
axis.text = element_text(color="white", size=rel(1.5)),
axis.text.y = element_text(hjust=1),
legend.text = element_text(color="white", size=rel(1.3)),
legend.background = element_rect(fill="gray20"),
legend.position = "bottom",
legend.title=element_blank()
)
pd<-ggplot(schz, aes(year, month, fill = SczBroad)) +
geom_tile(colour="gray20", size=1.5, stat="identity") +
scale_fill_viridis(option="D") +
scale_y_continuous(breaks=1:12, labels=month.abb[1:12])+
xlab("") +
ylab("") +
ggtitle("Total Australian Schizophrenics Born By Month and Year") +
theme(
plot.title = element_text(color="white",hjust=0,vjust=1, size=rel(2)),
plot.background = element_rect(fill="gray20"),
panel.background = element_rect(fill="gray20"),
panel.border = element_rect(fill=NA,color="gray20", size=0.5, linetype="solid"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
axis.text = element_text(color="white", size=rel(1.5)),
axis.text.y = element_text(hjust=1),
legend.text = element_text(color="white", size=rel(1.3)),
legend.background = element_rect(fill="gray20"),
legend.position = "bottom",
legend.title=element_blank()
)
@KKulma
Copy link

KKulma commented Jul 13, 2018

thanks for great data vis, where can I find reference to the dataset used here?

@ashgreat
Copy link

ashgreat commented Dec 3, 2018

thanks for great data vis, where can I find reference to the dataset used here?

It's in the season package on CRAN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment