microbiome / miaViz

Microbiome Analysis Plotting and Visualization
https://microbiome.github.io/miaViz
Artistic License 2.0
10 stars 12 forks source link

added order_descending to plotAbundanceDensity #31

Closed FelixErnst closed 3 years ago

TuomasBorman commented 3 years ago

I have not found out how to adjust the point coloring; they have now a black outer circle, and gray color by default.

Is the problem that colour match withcolour_by? Otherwise I think it should work, and colour should be passed further? Is there an argument that makes colour_by specific?

Error in retrieveCellInfo(object, colour_by) : cannot find 'red'

FelixErnst commented 3 years ago

How about this:

plotAbundanceDensity(tse[1:3,], abund_values = "relabundance",
                     order_descending = NA, point_shape = 19)
antagomir commented 3 years ago
plotAbundanceDensity(tse[1:3,], abund_values = "relabundance",
order_descending = NA, point_shape = 19)

Clearly better, yes, but edges in circles still remain. Passing the colour argument does not do the trick, and I have not yet found a solution by manipulating the points afterwards with geom_point() for instance.

Well, we can live with this now (adding example with pch=19 for clarity) but this is rather fundamental, how to manipulate key aspects of these visual objects. Similar needs may arise again.

FelixErnst commented 3 years ago

I think this is clearly a case of ggplot2 huge functionality. I can only change the default colour with a bit of weird code, since scale_fill_manual works only, when there is a scale.

p <- plotAbundanceDensity(tse[1:3,], abund_values = "relabundance",
order_descending = NA, point_shape = 19)
p$layers[[1]]$aes_params$fill <- "red"
p

The option advanced argument point_colour is now supported. However, I must say, that the default "grey70" looks better with the alpha set to 1

plotAbundanceDensity(tse[1:3,], abund_values = "relabundance",
                     order_descending = NA, add_legend = TRUE, point_colour = "black")
plotAbundanceDensity(tse[1:3,], abund_values = "relabundance",
                     order_descending = NA, add_legend = TRUE, point_colour = "black", point_alpha = 1) # Most horrible
plotAbundanceDensity(tse[1:3,], abund_values = "relabundance",
                     order_descending = NA, add_legend = TRUE, point_alpha = 1) # best
antagomir commented 3 years ago

Hmm yes. If there is no easy way to manipulate the figure either through function arguments, or through post-hoc manipulation of the ggplot object, then I think this is a clear limitation for the current system logic. But if there is no solution available, this is still acceptable I think.