plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

ordr: would please like geom_GeomAxis() implemented in plotly

Open byandell opened this issue 2 years ago • 0 comments

I want to use plotly on a GG of a biplot using package ordr. Creating issue as advised.

# Example taken from ordr::ggbiplot
# Also partly from <https://corybrunson.github.io/ordr/>

library(ordr)

# PCA of iris data
iris_pca <- ordinate(iris, cols = 1:4, prcomp, scale = TRUE)

# row-principal predictive biplot
p <- ggbiplot(iris_pca, sec.axes = "cols", scale.factor = 2) +
  geom_rows_point(aes(color = Species, shape = Species)) +
  stat_rows_ellipse(aes(color = Species), alpha = .5, level = .99) +
  geom_cols_vector() +
  geom_cols_text_radiate(aes(label = name)) +
  expand_limits(y = c(-3.5, NA)) +
  ggtitle("PCA of Anderson's iris measurements",
          "99% confidence ellipses; variables use top & right axes")

# GGplot as seen in <https://corybrunson.github.io/ordr/>
p

# Plotly of GGplot, but "geom_GeomAxis() not implemented"
plotly::ggplotly(p)

byandell avatar Jan 10 '24 22:01 byandell