jfq3/ggordiplots

Removing axes

Closed this issue · 2 comments

I am plotting the results of an NMDS ordination, and would like to remove axes tick marks, text, and titles. Is there a way to do this for gg_ordiplot? I have looked through the ggordiplots documentation and have tried standard ggplot2 syntax to do so, but have been unsuccessful.

jfq3 commented

You can do this by setting axis elements to element_blank() in the theme. Using ggordiplots for the base plot:

suppressPackageStartupMessages(library(vegan))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(ggordiplots))
data("dune")
data("dune.env")
nmds <- metaMDS(dune)
my.plot <- gg_ordiplot(nmds, groups = dune.env$Management, hull = TRUE, spiders = TRUE, ellipse = FALSE, plot = FALSE)
my.plot$plot +
  theme_bw() +
  theme(axis.title=element_blank(),
        axis.text=element_blank(),
        axis.ticks=element_blank())

Is this what you want?

image

Yes, thank you for the quick response!