-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difficulty plotting NMDS #7
Comments
It looks like the ordination is the same only flipped and scrunched on the vertical axis.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Rae Santora <notifications@github.com>
Sent: Friday, April 24, 2020 6:56:53 PM
To: jfq3/ggordiplots <ggordiplots@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [jfq3/ggordiplots] Difficulty plotting NMDS (#7)
◆ This message was sent from a non-UWYO address. Please exercise caution when clicking links or opening attachments from external sources.
Hello,
I am trying to plot an NMDS output from metaMDS(), which successfully plotted using ggplot(). I am trying to use ggordiplot to plot the same ordination and use the gg_envfit function to more easily add environmental vectors, however the plot itself isn't looking right. I can't get the right axes to be plotted.
##GGPLOT PLOT:
##PLOTTING NMDS
toPlot <- data.frame(NMDS1$points, Sample_ID = metadata$Sample_ID);
a <- ggplot(toPlot, aes(-MDS1, MDS2, colour=Sample_ID)) +
geom_point(size=3) +
xlab("NMDS1") +
ylab("NMDS2") +
theme(axis.text = element_blank(),
axis.ticks = element_blank(),
axis.title = element_text(size = 20),
legend.text = element_text(size = 20),
legend.title = element_text(size = 20),
#legend.key.size = unit(1.0, "cm"),
legend.key = element_rect(colour = "gray"));
a <- a + theme_bw() + theme(panel.border = element_blank(), panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black"));
a
[image]<https://user-images.githubusercontent.com/45110586/80267242-9eee1780-8654-11ea-9505-92a76d591254.png>
However when I plot using gg_ordiplot my output looks like this:
[image]<https://user-images.githubusercontent.com/45110586/80267313-deb4ff00-8654-11ea-85ac-a5db4e954314.png>
I cannot figure out how to change the axes.
I am sorry if this is a very remedial question - I am new to R and trying to figure it out as I go! Thank you!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#7>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFZCCFMPM7MZLIVNR5KAGQLROIYNLANCNFSM4MQQQVOQ>.
|
The reason the X axis is flipped is that you have a negative sign before MDS1 in the first plot. I cannot answer why the gg_ordiplot result looks as it does without the data. I find it curious that the Y axis label is NA. |
I fixed the problem with the axis labels. You will have to reinstall for my change to take effect. |
Thank you so much! I will reinstall and try again today. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I am trying to plot an NMDS output from metaMDS(), which successfully plotted using ggplot(). I am trying to use ggordiplot to plot the same ordination and use the gg_envfit function to more easily add environmental vectors, however the plot itself isn't looking right. I can't get the right axes to be plotted.
However when I plot using gg_ordiplot my output looks like this:
I cannot figure out how to change the axes.
I am sorry if this is a very remedial question - I am new to R and trying to figure it out as I go! Thank you!
The text was updated successfully, but these errors were encountered: