0

I am having some issues when trying to group lines into a single plot.

My data has the following structure:

enter image description here

I would like to plot the data grouping by 'run', but when I run the following code, I get wrong results:

ggplot(data, aes(x = epoch, y = accuracy, col = model)) + 
  geom_line(aes(lty = run)) +
  geom_smooth(se = FALSE)

enter image description here

However, if I change 'group' to 'lty', I get the 'right' results.

Can anyone point out what I am doing wrong?

enter image description here

Grant Miller
  • 27,532
  • 16
  • 147
  • 165
  • 3
    Could you provide some usable data and full script? I cannot see the group option. However it seems you're feeding the plot with the not aggregate data, but maybe I'm wrong. – s__ Sep 07 '18 at 14:41
  • 3
    It's always important to provide sample data in a copy&paste-able format. Please review how to provide a [minimal reproducible example/attempt](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). You should edit your post to include the output of `dput` based on (part of) your data. Screenshots are not helpful. – Maurits Evers Sep 07 '18 at 14:48

0 Answers0