0

So this is my code (simplified):

orderharvest <- c("march 1st", "april 2nd", "august 21st", "september 1st")

ggplot(fruitharvest, aes(x = type, y = mass, group = harvest, color = harvest))+
  geom_point(color = "white")+
  geom_smooth(method=lm, se = FALSE)

Thing is, I want to order the harvests by orderharvest. Normally I would add

fruitharvest$harvest = factor(fruitharvest$harvest, level = orderharvest)

But then the colour is removed, how do I get both?

The rest of the code:

I want to just see the trendlines, hence the color = "white". If there is a different way to do this I would love to know.

Thanks!

Phil
  • 5,491
  • 3
  • 26
  • 61
Djoeke
  • 3
  • 1
  • Welcome to SO! It would be easier to help you if you provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a snippet of your data or some fake data. If you want to post your data you type `dput(NAME_OF_DATASET)` into the console and copy the output into your post. If your dataset has a lot of observations you could do e.g. `dput(head(NAME_OF_DATASET, 10))` for the first ten rows of data. – stefan May 02 '22 at 15:15

0 Answers0