ChiLiubio / microeco

An R package for data analysis in microbial community ecology
GNU General Public License v3.0
181 stars 55 forks source link

Change text type and colors of taxa names in plot_heatmap #318

Open Taiyou187 opened 5 months ago

Taiyou187 commented 5 months ago

How do I change the text type and color of the taxa name? I tried to make it but I can't change the type of text to "Italic" and "Black" color of the taxa name in plot_heatmap

show 20 taxa at Species level

t1 <- trans_abund$new(dataset = dataset, taxrank = "Species", ntaxa = 20) t1$plot_heatmap(facet = c("Season"), xtext_keep = FALSE, withmargin = FALSE)

Would you like to help me to do it?

ChiLiubio commented 5 months ago

Hi. You can add a command of ggplot2.

g1 <- t1$plot_heatmap(facet = c("Season"), xtext_keep = FALSE, withmargin = FALSE)
g1 + theme(axis.text.y = element_text(face = 'italic', color = "black"))
Taiyou187 commented 5 months ago

Hi, thank you so much for your help.

I got another issue when running the analysis below

calculate and plot sample distances between groups

t1$cal_group_distance(within_group = FALSE) The result is stored in object$res_group_distance ... t1$cal_group_distance_diff(method = "wilcox") Error in combn(unique(groupvec), i) : n < m

Can you help me again?

Best

ChiLiubio commented 5 months ago

Could you please attach your data so that I can reproduce your issue? To save the t1 and dataset, please follow the steps in the tutorial (https://chiliubio.github.io/microeco_tutorial/notes.html#save-function) and attach the compressed object. Please also attach the steps.