Hello everyone,
I am trying to make a graph, similar to the supplementary figure 2b in this file: https://static-content.springer.com/esm/art%3A10.1038%2Fs41467-020-17740-1/MediaObjects/41467_2020_17740_MOESM1_ESM.pdf.
I suppose my code should be like:
pdf(file='byconditiontop10.pdf',width=20) DotPlot(data, features =c("DCN", "COL1A2", "CFD", "KLRB1" ), split.by="condition")+ theme(axis.text.x = > > > element_text(angle = 90))
But I received following error:
Error in DotPlot(data, features = c("DCN", "COL1A2", : ge, Monocytes, Basal cell, Acinar, bcell, Not enough colors for the number of groups
I hope you guys could give me some advices how to deal with issue.
Best Andy
How many conditions do you have? According to the following GitHub issue https://github.com/satijalab/seurat/issues/1414 if you have more than two groups defined in your
split.by
variable then you need to provide a vector of colors.and the
DotPlot
documentation statesI have 5 conditions. So I should add collar command? like >cols=c("lightgrey", "red")
My study included 10 different studies, and I add the color command, but the system still saying there are some error with my code.
I think I might should not add color like this?
the color parameter is
cols
notcol
, can you try again after editing your code?Also, don't use ">" to format you text as a code block, use a triple back tick like "```". For more markdown formatting details, see https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#styling-text
It worked! Thank you so much!
Could you create a minimal example using something like colab?
https://colab.research.google.com/notebook#create=true&language=r