I want to create a plot with secondary axis, I am able to code using GGPLOT as follows
g1<- ggplot(data = tmp6,aes(x=Month, y=Total,group = Teams)) +
geom_line(aes(color = Teams),size = 1)+
geom_bar(aes(x=Month,y=Failed,color=Teams,group=Teams))+
geom_point(aes(color = Teams),size = 3)+
ggtitle(label = paste('Total for all Teams'))+
scale_y_continuous(sec.axis = sec_axis(name="secondary axis"))+
labs(x = "Month", y = "Total") +
theme(axis.text.x = element_text(angle=45, hjust = 1))
g1
I want to get total in left y axis with line and failed in right y axis with bar, my x axis will be month
I am not getting the secondary plot here, any idea.