title: error: ggplot2 facet is plotting incorrect values
body: <p>I am trying to plot a three-way interaction in ggplot2 but it appears that the values in the generated plot, especially in the middle column, do not correspond to the values in my dataset, i.e., the raw data shows that nonwords were always slower than real words, but the middle column is showing the opposite pattern. I tried plotting another figure using similar code and data and incorrect values were again plotted.</p>
  
  <p>Would appreciate it if anyone could tell me where the error in my code is.</p>
  
  <pre><code>g &lt;- ggplot(m.df, 
         aes(x = ZMemScore,
             y = exp(m.df$fit),
             color = factor(Type))) +
    geom_ribbon(aes(ymin=exp(m.df$lower), ymax=exp(m.df$upper), color = NA, fill = factor(Type)), linetype = 1, alpha=0.3) + 
    geom_line(aes(linetype = Type), size = 1.2) +
    xlab("ZMemScore") + ylab("Predicted RT (ms)") + labs(color = "Type", subtitle ="ZQVT") +
    facet_grid(. ~ ZQVT) +
    scale_linetype_discrete(name='Type', labels=c('Nonword','Real Word')) +
    theme_classic() + scale_color_manual(values=c("black", "firebrick2")) + theme(plot.subtitle = element_text(hjust = 0.5)) +
    theme(text = element_text(size=14))+
    guides(fill = FALSE, color = FALSE)
  plot(g)
  </code></pre>
  
  <p>The generated plot: <a href="https://i.stack.imgur.com/IytLr.png" rel="nofollow noreferrer">https://i.stack.imgur.com/IytLr.png</a></p>
  
  <p>The values that were to plotted: <a href="https://i.stack.imgur.com/kPMRR.png" rel="nofollow noreferrer">https://i.stack.imgur.com/kPMRR.png</a></p>
  
  <p>Thanks!</p>