### Figure 1.3: Percentage of all child heart surgery being carried out in each of thirteen hospitals

Data are shown in Table 1.1 (page 23) and are contained in 01-1-child-heart-survival-x.csv. The data were originally presented in the NCHDA 2012-15 report, but are best seen on childrensheartsurgery.info.

library(ggplot2)

df$Percentage = 100*df$Operations/sum(df$Operations) df$Pos= rank(df$Percentage) First in R base graphics par(mar=c(5,15,4,2)) barplot(df$Percentage,names.arg=df\$Hospital,horiz=T, xpd=F,las=1, xlab="Percentage of all operations in 2012-15 \nthat are carried out in each hospital")
bp <- ggplot(df, aes(x=reorder(Hospital,-Pos), y=Percentage, fill=Hospital)) #sets initial plot object from the dataframe for Hospitals, reordered by Percentage (descending) as the y-values, colour-filled by Hospital
bp # draws the plot