6
votes
Accepted
Density plot, scale it to 0-1
I'm not fully to have understood your second questions, but first, if you want to scale the density to 1, you can use y= ..scaled.. in your ...
5
votes
Accepted
Mapping a list of cells in seurat featureplot
To color the TSNEPlot, you can generate a new column in metadata with the expression levels (High, low, etc). Then use pt.shape to set a shape for each identity.
To show binary expression based on ...
5
votes
How to set the position of groups in a Seurat object on a FeatureHeatmap plot
I don't think this is possible in Seurat v2, but in v3 you can change the factor levels of the grouping variable to change the plot order:
...
5
votes
Accepted
Changing the legend names
You don't have any continuous fill scales, since you're filling according to Condition, which is a factor. This is leading to the ...
5
votes
How to enlarge a section of y-axis?
I would strongly discourage you from making discontinuous axis, it's going to be very confusing for a reader.
The facet plot you proposed seems like a good solution to me. Alternatively you can use ...
4
votes
Accepted
Percentage distribution of cells in all clusters based on their treatment condition?
Here is a solution using dplyr and ggplot2:
...
4
votes
Accepted
How can I find out the code DRIMSeq uses to make dmplotProportions objects?
I was curious how they have done it as well, so here expanded @Liopis comment :
...
4
votes
Changing the axis limits of ggplot objects
Axes for ggplots can be controlled via xlim() and ylim() functions. You can try:
...
4
votes
Accepted
Create a Grouped Barchart
I have noticed a few errors:
1) You define a bunch of variables (Species, Class, ...) but then instead of creating your data frame data with these you create it by reading from text. I don't think ...
4
votes
Accepted
Pulling out a certain gene in a volcano plot
As you did for labeling genes with an adjusted p value below 0.05, you can subset your dataset for keeping only rows corresponding to "Casp14":
...
4
votes
Accepted
Griding ggplot object in r
What you are looking for is facetting. Using this key word on any search engines you will find dozen of answers describing its use: https://ggplot2.tidyverse.org/...
4
votes
Accepted
Plot information stored in dataframe within a tree (ggtree)
You can accomplish this using the ggtree package available on Bioconductor.
First you will need to combine your tree with the data.
...
4
votes
A two color bar plot in R
Using Google well is one of the best skillsets you can possibly learn in programming-allied fields. The style of plot you're looking for is a "grouped bar plot". I googled "r grouped ...
4
votes
Accepted
Removing missing categories from geom_bar
I was able to get it to work by converting the column in the dataframe to a character using this command:
df$day <- as.character(df$day)
and it worked like a ...
3
votes
Multiple line chart
Couple of things regarding your code:
It would be good to have your data frame in long format for ggplot2
For having the x-axis ordered chronologically, you have to specify it manually, otherwise it ...
3
votes
Accepted
FeaturePlot from Seurat: change its title
I tried with some data that I have and this is working for me:
...
3
votes
Accepted
How to plot p-values in a circular barplot?
The adjustcolor function from grDevices can be used to generate colours with transparency. What you want is colours based on the ...
3
votes
Accepted
Question about the dots on Quartile groups in boxplot
You add the points with geom_point(). Just remove it and you will get your "empty" boxplot.
...
3
votes
Accepted
Changing a wide range of colours to a limited gradient
If you would like to color discrete intervals on a gradient as opposed to having a continuous gradient (like your second plot), use this approach.
It is similar to the approach in the answer I ...
3
votes
Changing a wide range of colours to a limited gradient
TSNEPlot()
TSNEPlot() will always treat your variables as discrete. My approach is to manually generate a gradient with unique colors for each factor level and ...
3
votes
Accepted
Visualizing the difference among three groups
Here a way to do it is to start first by creating a dataset containing your three different group, based on the few lines you display:
...
3
votes
Accepted
Grouping a set of genes in a ggplot object
If you had the classification into oncogene/TSG for each gene in a column (let's call it gene_class) in lmuts, you could split ...
3
votes
Accepted
Getting weird plot with ggpubr package
The problem is the scale used: For the plot you called "weird" (first from the top), the scale is 50 and for the "ggplot only" (third from the top) the scale is 1.
You should play with the ...
3
votes
Accepted
Very low probability densities
It is not like your conventional frequency which adds up to one. The density is low because the width of your bins is huge, and the number of observations you have is low. From this by Wickham, the ...
3
votes
Arrange ggplot Figure for scRNA-seq data
On top of M__'s suggestion to reduce the point alpha, here are a few other things you can implement to make your figures cleaner:
Remove grid lines from the panel backgrounds
...
3
votes
Violin plots appear as vertical lines
I believe the reason is simply LTA and LTB not being expressed (or their expression not being detected due to technical limitations). If you would set the pt.size ...
3
votes
Accepted
How to make a violin plot around quasirandom dots
You are almost there, if you set the alpha parameter within your geom_violin() call (to sth like 0.1) you should be able to get ...
2
votes
2
votes
Plot to show the expression of genes between tumor and normal
You'll want to use long-form data for everything:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ggplot2 × 80r × 64
seurat × 17
scrnaseq × 12
visualization × 8
rna-seq × 7
single-cell × 5
upsetr × 4
phylogenetics × 3
statistics × 3
phylogeny × 3
python × 2
bioconductor × 2
microarray × 2
pca × 2
heatmap × 2
dataframe × 2
ggtree × 2
sequence-alignment × 1
fasta × 1
proteins × 1
differential-expression × 1
clustering × 1
rna × 1
wgs × 1