fix variable for ggplot figure