ggplot2: How to format the sec.axis properly in R
问题 I am trying to plot 3 lines using geom_line() in my ggplot graph. One of the variables has a different scale so I am trying to use the sec.axis in order to show it as well. library(ggplot2) library(reshape2) tab <- data.frame(year = seq(1979,2010), freq = runif(32, 212,283), max = runif(32, 962.1, 993.4), med = runif(32, 972.1, 989.3), min = runif(32, 955.7, 978.3)) summary(tab) # the column freq (frequency) has a different scale comparing with the other ones Some code I've tried. tab <- melt