Skip to content

Commit

Permalink
fix warning in mipLineHistorical
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Feb 28, 2024
1 parent 192c97e commit aa07024
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions R/mipLineHistorical.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,17 @@ mipLineHistorical <- function(x,x_hist=NULL,color.dim="identifier",linetype.dim=
#fill: add colors for historical and keep shape symbol
#alpha: add colors for projection depending on leg.proj
p <- p + scale_color_manual(color.dim.name,values = color_set, breaks=model_output,labels=model_output,guide=guide_legend(order=1,title.position = "top", ncol=legend.ncol))
p <- p + scale_fill_manual("Historical data",values = color_set[historical],breaks=historical,
guide=guide_legend(override.aes = list(colour=color_set[historical],shape="+",linetype=0,size=5),order=2,title.position = "top", ncol=legend.ncol))

if (!is.null(x_hist)) {
p <- p + scale_fill_manual("Historical data",
values = color_set[historical], breaks = historical,
guide = guide_legend(override.aes = list(
colour = color_set[historical],
shape = "+", linetype = 0, size = 5
), order = 2, title.position = "top", ncol = legend.ncol)
)
}

if(leg.proj) p <- p + scale_alpha_manual("Other projections",values = seq(0.1,1,length.out = length(projection)),breaks=projection,labels=projection,guide=guide_legend(override.aes = list(colour=color_set[projection],shape=NULL,linetype=1,linewidth=1,alpha=0.5),order=3,title.position = "top", ncol=legend.ncol))
else p <- p + scale_alpha_manual("Other projections",values = seq(0.1,1,length.out = length(projection)),breaks=projection,labels=projection,guide=guide_legend(override.aes = list(colour="#A1A194",shape=NULL,linetype=1,linewidth=1,alpha=0.5),order=3,title.position = "top", ncol=legend.ncol))
p <- p + guides(linetype=guide_legend(order=4,title.position="top",ncol=legend.ncol))
Expand Down

0 comments on commit aa07024

Please sign in to comment.