Relative Content

Tag Archive for rggplot2legend

Add legend after using gg.gap

I have a data set with a big negative value, so I used gg.gap package to make a discontinuous y-axis. The code worked well but after adding the function gg.gap the legend was deleted.
I tried adding a legend using the add.legend argument but it didn’t work.
Am I doing something wrong?
Here is a sample code

Order of ggplot ignoring order of legends

With the following data, I am trying to create a plot as shown, but the order of legends as: mgCST Group, CST Group, Treatment Status. However, ggplot is ignoring all attempts to order the legends