Hot answers tagged

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 ...
dc37's user avatar
  • 1,041
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 ...
Mack123456's user avatar
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: ...
TimStuart's user avatar
  • 674
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 ...
Devon Ryan's user avatar
  • 19.6k
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 ...
Kamil S Jaron's user avatar
4 votes
Accepted

Percentage distribution of cells in all clusters based on their treatment condition?

Here is a solution using dplyr and ggplot2: ...
TimStuart's user avatar
  • 674
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 : ...
Kamil S Jaron's user avatar
4 votes

Changing the axis limits of ggplot objects

Axes for ggplots can be controlled via xlim() and ylim() functions. You can try: ...
haci's user avatar
  • 4,092
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 ...
haci's user avatar
  • 4,092
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": ...
dc37's user avatar
  • 1,041
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/...
dc37's user avatar
  • 1,041
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. ...
Mosquite's user avatar
  • 155
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 ...
Ram RS's user avatar
  • 2,299
4 votes

Display row and column names in R

You don't, simple as that, it is too many in both columns and rows to show them all. You could shrink size, but then it becomes unreadable. You can highlight individual genes (rows) that are important ...
ATpoint's user avatar
  • 1,137
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 ...
rimo's user avatar
  • 963
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 ...
plat's user avatar
  • 1,032
3 votes
Accepted

FeaturePlot from Seurat: change its title

I tried with some data that I have and this is working for me: ...
plat's user avatar
  • 1,032
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 ...
Tom Kelly's user avatar
  • 873
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. ...
Mr_Z's user avatar
  • 629
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 ...
Kohl Kinning's user avatar
  • 1,149
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 ...
Kohl Kinning's user avatar
  • 1,149
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: ...
dc37's user avatar
  • 1,041
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 ...
mrhd's user avatar
  • 363
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 ...
haci's user avatar
  • 4,092
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 ...
StupidWolf's user avatar
  • 1,688
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 ...
acvill's user avatar
  • 613
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 ...
haci's user avatar
  • 4,092
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 ...
haci's user avatar
  • 4,092
3 votes
Accepted

How to change the position of groups colors in DimPlot of Seurat

DimPlot returns a ggplot object, so ggplot functions can be applied to it. You can change the legend position like this: ...
Cloudberry's user avatar
2 votes

Error in annotating row names as data points in a PCA plot

Maybe try ...
Pascal Martin's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible