Closed perseeker closed 4 months ago
Hi,
I believe you can use hex color codes as well. Basically, any single value parameter should be fine. I'm pretty sure you can convert this format to hex code through Matplotlib but please let me know if you still have the problem
I'd like to not specify colors by hand, and instead use pre-made colormaps, like from maplotlib.cm. I tried to form a list of colors first, by using
list([plt.cm.tab20b(j) for j in range(20)])
- this produces a list of 20 colors in format (x, y, z, 1) I then used this list to define colors for metadata categories in my pyWGCNA object, but ran into a problem - colors in this format are interpreted as an iterable instead of a single entry. In particular, when runninganalyseWGCNA()
, functionplotModuleEigenGene
tries to broadcast the color as an object of length of 4 instead of 1 (line:color = np.where(color == n, self.metadataColors[m][n], color)
) So I ask - is there a way to specify colors without using pre-set labels?