GGPlot

Plot multiple Stations in one plot
library(ggplot2) ggplot(Data,aes(x=Date,y=value,colour=variable,group=variable)) + geom_smooth(method = "loess", span = 1.0, se = TRUE) + labs(title="Title ",         subtitle="Subtitle",          y= "T",         x = "Time") + scale_color_manual(name = "Station",                       values = c ("St1" = "mediumblue", "St2" = "skyblue1", "St3" = "darkmagenta", "St4" = "magenta", "St5" = "orange", "St6" = "yellow", "St7" = "darkgreen", "St8" = "lawngreen", "St9" = "brown1", "St10" = "saddlebrown"))

Plot multiple years of one Station in one Plot
Ref_Data$Year = gsub("-.*", "", Ref_Data$Date) Ref_Data$Month = substr(Ref_Data$Date,6,7) Ref_Data$Month = as.numeric (Ref_Data$Month) month_summary = aggregate(DENI011 ~ Month + Year, data = Ref_Data, mean) month_summary$Month = month.abb[month_summary$Month] month_summary$Month = factor(month_summary$Month, levels = month.abb) ggplot(month_summary, aes(Month, Station, color = Year, group = Year)) + geom_path + labs(title="Title",       subtitle="Subtitle",        y= "T")
 * 1) Extract year
 * 1) Extract month
 * 1) Monthly mean
 * 1) Short names month

GGPlot - Grouped barplot
library(reshape) Data <- melt(Data, id=c("Year")) Data [,1] = as.character(Data[,1]) colnames(Data)[2] <- "Characteristics" colnames(Data)[3] <- "Value" ggplot(Data, aes(fill=Characteristics, y= Value, x=Year)) + geom_bar(position="dodge", stat="identity") + labs(title="Title",       subtitle="Subtitle",        y ="Values [T]", x = "Year") + scale_fill_manual(values=c("#cc0000", "#cccc00", "#003300"))

GGPlot - Classic Time Series
library(ggplot2) theme_set(theme_gray) ggplot(data = Stations, aes(x = Date, y = Station)) + geom_line(color = "grey27", size = 1) + labs(title="Title",       subtitle="subtitle",        x = "Year",        y = "T [T]") + scale_x_date(date_labels="%Y",date_breaks ="1 year")+ geom_smooth(method = "loess", color ="blue") + geom_smooth(method = "lm", color ="red")

GGPlot - Boxplot
library(ggplot2) ggplot(FullStats, aes(group = Cluster.Nummer, x=Cluster.Nummer, y=Change, fill=Cluster.Nummer)) + geom_boxplot+ labs(title="Title",       subtitle="subtitle",        x = "Cluster",        y = "Change[%]") + scale_fill_manual(name = "Cluster",                    values = c ("Cluster1" = "yellow", "Cluster2" = "orange", "Cluster3" = "red", "Cluster4" = "purple", "Cluster5" = "blue", "Cluster6" = "darkgreen", "Cluster7" = "brown")) + guides(fill=FALSE) + scale_x_discrete(labels=c("Cluster1" = "1", "Cluster2" = "2", "Cluster3" = "3", "Cluster4" = "4", "Cluster5" = "5", "Cluster6" = "6", "Cluster7" = "7"))

Diverging Bar Plot
SkillScoresPlot$ScoreType <- ifelse(SkillScoresPlot$SkillScore < 0, "below", "above") SkillScoresPlot <- SkillScoresPlot[order(SkillScoresPlot$SkillScore), ] SkillScoresPlot$Predictor <- factor(SkillScoresPlot$Predictor, levels = SkillScoresPlot$Predictor) library(ggplot2) theme_set(theme_bw) ggplot(SkillScoresPlot, aes(x=`Predictor`, y=SkillScore, label=SkillScore)) + geom_bar(stat='identity', aes(fill=ScoreType), width=.5)  + scale_fill_manual(name="Skill Score",                     labels = c("Positive", "Negative"),                     values = c("above"="#00ba38", "below"="#f8766d")) + labs(subtitle="Diverging Bars Plot",        title= "Skill Scores for all Predictors (t2m included) and Periodes") + coord_flip
 * 1) Add above or below zero
 * 1) Sort Dataframe
 * 1) Save as factors to maintain order
 * 1) Diverging Barcharts