5

This is the first time I've encountered an issue with not using the Queen's spelling: if I call autoplot with colour= I get the points colored according to the referenced variable, but if I write color= the argument gets ignored and everything is plotted in black. Code:

library(ggfortify)
library(cowplot)

pca_res <- prcomp(iris[1:4], scale = TRUE)

british <- autoplot(pca_res, data=iris, colour='Species')
us <- autoplot(pca_res, data=iris, color='Species')

plot_grid(british, us, labels=c('colour', 'color'))

enter image description here

Is this an issue with ggplot2 itself (I doubt it, I've never run into it previously), with autoplot or with ggfortify? I'd like to report it as a bug but I'm not 100% sure where the problem is. Thanks!

C. Murtaugh
  • 574
  • 4
  • 15
  • 4
    Looks like `autoplot` calls `autoplot.prcomp` which is an alias for [`autoplot.pca_common`](https://github.com/sinhrks/ggfortify/blob/912ba6d39feb1537b30997632b1d125500c1058d/R/fortify_stats.R#L252-L342) that calls [`ggbiplot`](https://github.com/sinhrks/ggfortify/blob/9eaefc64ace42659bea852e28bd583e93f5a3aad/R/plotlib.R#L510-L546) that has no *color* argument, I'd say `maintainer("ggfortify")` to commend them that "u" matters. – Donald Seinen Jul 29 '22 at 05:13
  • For future visitors, related issue (not fixed yet): https://github.com/sinhrks/ggfortify/issues/224 – bretauv Jan 04 '23 at 10:52

1 Answers1

1

This issue has now been fixed.

Mark
  • 7,785
  • 2
  • 14
  • 34