jfq3 / ggordiplots

Make ggplot Versions of Vegan's Ordiplots
GNU General Public License v2.0
6 stars 2 forks source link

Removing axes #1

Closed mfisher5 closed 6 years ago

mfisher5 commented 6 years ago

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 6 years ago

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

mfisher5 commented 6 years ago

Yes, thank you for the quick response!