Changing size of text labels in gl.pcoa.plot + scaling

22 views
Skip to first unread message

Gabriella Scatà

unread,
Oct 26, 2022, 11:03:24 PM10/26/22
to dartR
Hi,
I would like to change the size of the PCA plot labels and axis ticks labels & axis names/labels.
Is there a way to do that?
I tried with theme() but it doesn't seem to work.

Also,
I would like to scale the plot by the explained var% of each axis, but because 1 axis = 0.3% and the other 35% then I don't get basically any plot just a line...is there a way to still see the difference in the contribution of each axis visually rather than just by the %var explained as I can't use scale?

Thanks a lot as usual,
Best,
Gabriella

Gabriella Scatà

unread,
Oct 27, 2022, 12:58:40 AM10/27/22
to dartR
Also, is there a way to flip the visualisation over an axis? for some reason it keeps changing from one graph to the other even if the distribution of points is very similar.
So, for example, i always have axis 1 on the x axis & axis 2 on the y axis, but the direction of axis 2 changes...so that sometimes the values are positive and other times negative but the absolute value of the loadings is the same...in normal PCA I think you can change the direction of visualization in the plot by using PCA$rotation? But I am not sure whether I can do it in dartR with gl.pcoa.plot?

Thanks a lot!
Best,
Gabriella

Jose Luis Mijangos

unread,
Oct 30, 2022, 2:10:31 PM10/30/22
to dartR
Hi Gabriella,

I cannot think about other method to display the variance explained in the axes, other than the two methods already implemented using the parameter "scale" (TRUE or FALSE).

For your other questions please see the code below.

Cheers,
Luis

library(dartR)

test <- platypus.gl
pcoa <- gl.pcoa(test)
# running the function with save2tmp = TRUE to save the plot and tables in
# the temporal directory.
# As explained in the documentation you can change the size of the labels using
# the parameters:
# - label.size    Specify the size of the point labels [default 1].
# - axis.label.size    Specify the size of the displayed axis labels [default 1.5].

gl.pcoa.plot(pcoa,test,  label.size = 2, axis.label.size = 3,save2tmp = TRUE)

# listing the plots and tables in tempdir
gl.list.reports()
# choosing the plot or table to retrieve
res <- gl.print.reports(1)
# changing axes labels
res +  labs(x = "Label X", y = "Label Y")

# As explained in the documentation you can choose in which axis you want to plot a specific ordination
# - xaxis    Identify the x axis from those available in the ordination [default 1].
# - yaxis    Identify the y axis from those available in the ordination [default 2].

gl.pcoa.plot(pcoa,test,xaxis = 2,yaxis = 1)
Reply all
Reply to author
Forward
0 new messages