Function plot in ggplot incorrectly displayed as constant line-Tech Notes