R

Special Characters and Substitue Paramter with Real Value in ggplot

Sometimes we need to add some sepcial characters, like greek letters, into a figure with ggplot. The common way is using the function ‘expression’ in ggplot. However, it is tricky when you want to combine special charcters and replace a parameter with real value in the expression at the same time. For example, we need to generae figures in a for loop. In each iteration of the loop, a value is calculated and then we want to put it into x or y lab.