ChiLiubio / microeco

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

Modifying colors to cal_autcor #416

Open Manso002 opened 20 hours ago

Manso002 commented 20 hours ago

Hello everyone! Thanks so much for such amazing tool!

I am having trouble changing aesthetics values to the cal_autocor function. I have managed to change plots colors but I can't find a way to change the sample group name color. The code I tried is this:

plot_corr <- t1$cal_autocor(group = "Soil_type") plot_corr <- plot_corr + scale_color_manual(values = c("Bare_soil" = "#B39DDB", "Veg_soil" = "#F4A261")) + scale_fill_manual(values = c("Bare_soil" = "#B39DDB", "Veg_soil" = "#F4A261")) +
theme( legend.title = element_blank(), # Sin título en la leyenda legend.position = "top", # Leyenda en la parte superior legend.text = element_text(colour = c("#B39DDB", "#F4A261"))
)

plot_corr <- plot_corr + guides(fill = guide_legend(override.aes = list(color = c("#B39DDB", "#F4A261"))))

Hope you can help me. Thanks in advance

Carlos

ChiLiubio commented 3 hours ago

Hi. Thanks for your appreciation. Please see the help document of trans_env. There is a parameter color_values in cal_autocor function controlling the colors.

Chi