standard deviation area in hysteresis like plot using ggplot in r

375 Views Asked by At

I'm trying to plot an hysteresis like curve (mean of other curves) using ggplot2, and I would like to have the area of the standard deviation appear over it.

I'm using the following code:

xlabel <- "E [V]"
ylabel <- "I[pA]"
plotdata <- data.frame(x = x21, 
                       y = probe_02_cv$Mean, 
                       lower = (probe_02_cv_m), 
                       upper = (probe_02_cv_M))

ggplot(plotdata) + 
  geom_line(aes(y = probe_02_cv$Mean, x = x21, colour = "Mean probe2")) +
  geom_ribbon(aes(ymin = lower, ymax = upper, x = x21, fill = "st.dev"), alpha = 1) +
  scale_colour_manual("", values = "blue") +
  scale_fill_manual("", values = "grey12") + 
  xlab(xlabel) + 
  ylab(ylabel)

and graphically the result isn't very readable...

enter image description here

Anyone has a good idea on how to solve this?

0

There are 0 best solutions below