As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [ggplot2]

Advanced R visualisation and plotting package based on the grammar of graphics. ggplot2 is also available in Python via 'plotnine' which uses ggplot2 code

Filter by
Sorted by
Tagged with
-1 votes
1 answer
45 views

change the order in ggplot

I'm trying to make a plot that looks like this: This is a rudimentary plot I did in excel. It's a plot of reads by length. Very simple nothing crazy to it. The important thing to note is that it's ...
rimo's user avatar
  • 494
-2 votes
1 answer
67 views

Histogram plot using R/python with two variables[BC and Control] and their corresponding gene names

How do we plot histogram in R\Python with two variables[BC and Control] and their corresponding gene names examples is below: Thank you,
Mahendra Singh's user avatar
1 vote
1 answer
209 views

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

I have a Seurat object and plotted the Dimplot for UMAP visualization for 2 variables, as shown in the image below. Now, the problem is that I want the group by variables such as ...
cst's user avatar
  • 113
2 votes
2 answers
60 views

Display row and column names in R

I have plotted a heat-map with 235 rows and 570 columns which is below: how do we make clear names of row and columns on this graph using R?
Mahendra Singh's user avatar
2 votes
0 answers
118 views

Expending UpsetR plot with Orthofinder families and gene numbers

I can create an Upset plot with the input file, which can be found here ...
user3523406's user avatar
0 votes
1 answer
55 views

Manually order the set fails in UpsetR

This question was also asked on Biostars I have tried to use UpsetR to visualise the input file, which can be found here. How is it possible to make UpsetR accept an order defined in ...
user3523406's user avatar
2 votes
1 answer
56 views

Can I run dotPlotly from Rstudio?

I'd like to run dotPlotly from RStudio but I can't find any description/help for this. Is it at all possible? Another side to this question: does anyone know any tool for dot plots for genome ...
SKay's user avatar
  • 23
3 votes
1 answer
87 views

How to make bar bigger in UpsetR plot

I have tried to use UpsetR to visualize the input file which can be found here. ...
user3523406's user avatar
0 votes
1 answer
91 views

replacement has 1 row, data has 0

I have tried to use UpsetR to visualize the input file which can be found here ...
user3523406's user avatar
1 vote
0 answers
76 views

Create VIP plot using R from the SIMCA VIP values

I am using SIMCA software to perform multivariate analysis and want a VIP scores plot in R as shown below. which package is used for this type of plot (image retrieved from Google-images)??
Najeha Mohamed's user avatar
2 votes
1 answer
38 views

How to plot stacked bar chart using R showing mean with range and labelled values?

I am trying to plot a stacked bar graph with mean values from multiple repeats, also showing the range of the data and values labelled. My data frame is below: ...
Yuhong Jin's user avatar
2 votes
3 answers
717 views

How to remove black outline from Seurat's VlnPlot violin plot

Using Seurat's VlnPlot, how can I remove the black outline around the violin plot? For example, how can I change from the following graph with a (black) outline: ...
Charles's user avatar
  • 516
0 votes
0 answers
128 views

Changing color scheme for jitters inside violin plot

I want a plot like below By this code I get this plot but as you see the point color inside the violin is not really similar to what I want Any suggestion to get a similar color scheme for dots ...
Exhausted's user avatar
  • 1,801
1 vote
1 answer
192 views

How to make a violin plot around quasirandom dots

I want to have a plot violin plot around quasirandom dots - like below This is my data ...
Exhausted's user avatar
  • 1,801
1 vote
1 answer
65 views

Jitter violin coloured by sample id

I want to have a jitter violin coloured by sample ids but I get this weird plot ...
Exhausted's user avatar
  • 1,801
2 votes
1 answer
38 views

ggtree:How to keep leading zero ‘0’ in the tiplabel?

I am using ggtree to draw a phylogenetic tree. Some taxa IDs have a 0 at the beginning. However, when I plot the tiplabel the leading zero is automatically dropped. ...
YP CHEN's user avatar
  • 81
0 votes
1 answer
348 views

Violin plots appear as vertical lines

I want to perform a violin plot from a Seurat object and I rather have vertical lines. How can I stop this and rather have a standard Violin plot? code ...
Charles's user avatar
  • 516
3 votes
1 answer
994 views

Grouping x-axis in scatter plot

I am trying to plot one scatter plot for each group, where each group has continous values in x-axis. Reference Data Gives continuous x-axis but all groups are combined. ...
user98059's user avatar
  • 347
2 votes
0 answers
68 views

Pulling out genes in a scatterplot

I'm comparing gene expression among 2 different datasets (in vivo and in vitro) I have made a heatmap showing the correlation for each and then plotted the data frame to create a scatterplot. Now I ...
mmpp's user avatar
  • 361
1 vote
1 answer
86 views

A two color bar plot in R

I have raw read counts of miRNAs in two conditions like below ...
Exhausted's user avatar
  • 1,801
4 votes
2 answers
82 views

Arrange ggplot Figure for scRNA-seq data

I have generated a ggplot for 8 single-cell libraries, with the purpose of visualizing the tSNE facet plot by sample, colored by cell type -- with percentages. The best I could get to is this - ...
ShaniS's user avatar
  • 51
2 votes
0 answers
26 views

Calculating percent mouse cells per sample

I want to see the correlation between % mouse reads per sample vs % mouse cells per sample. I've already calculated the % mouse reads per sample but I'm stuck on calculating the % of mouse cells per ...
mmpp's user avatar
  • 361
0 votes
2 answers
980 views

ViolinPlot x-axis

I'm trying to set the x-axis in my Violin Plot to go by each patient rather than it being scattered. ...
mmpp's user avatar
  • 361
1 vote
1 answer
76 views

How to plot the gap distribution of contigs wrt to reference genome

I have a contigs file that I generated using Minia and then I have used Minimap2 to map these contigs again to the reference genome. Now I want to plot the gap distribution i.e. gap distance of the ...
my_new_user's user avatar
1 vote
1 answer
322 views

Barplot without alphabetizing x-axis

I'm inputting a .csv file and then plotting a barplot based on the colnames but when I go plot the order the names are being alphabetized rather than get the order that is in the .csv file. How to I ...
mmpp's user avatar
  • 361
1 vote
2 answers
2k views

PCA plot in R coloured by sample type

I'm a biologist, not a programmer so please be gentle. So I have a dataset that looks like ...
Athon's user avatar
  • 23
-1 votes
1 answer
107 views

Multiple box plot

I am using below code to plot multiple box plot but I am still struggling to understand how I can add whisker to box plot and how to change sample order like in this figure SampleType? ...
bioinfonext's user avatar
1 vote
0 answers
48 views

How to call this : some dots in volcano plot aligned a line after add a very small value to padj

when I plotting the volcano plot, I got some dots very top of the Y-axis because their padj nearly reached 0(I checked the data, I think they are reliable), so I followed the advice to add a very ...
Chu's user avatar
  • 13
1 vote
1 answer
612 views

ggplot2 geom_bar() , do not merge y-values shared same x-ids [closed]

I am plotting a barplot using ggplot + geom_bar() function in R. I have some the recoreds which share the same x-axis ...
YP CHEN's user avatar
  • 81
2 votes
1 answer
274 views

Plot information stored in dataframe within a tree (ggtree)

Hello to the entire Stackoverflow community! I'm writing to you because I'm currently building a phylogeny with ggtree and I have in parallel a table like this one: df : ...
chippycentra's user avatar
0 votes
1 answer
64 views

Very low probability densities

I'm generating a density plot using the ggplot2 library: ...
rishi's user avatar
  • 353
0 votes
1 answer
905 views

Getting weird plot with ggpubr package

I have a data frame for two groups and 9 variables ...
Exhausted's user avatar
  • 1,801
1 vote
2 answers
96 views

Grouping a set of genes in a ggplot object

I have a boolean matrix of mutated or non mutated genes across some samples ...
Exhausted's user avatar
  • 1,801
-4 votes
1 answer
64 views

How to visualise the proportion of clonal genes to sub clonal genes [duplicate]

I have a data frame ...
Exhausted's user avatar
  • 1,801
-4 votes
1 answer
73 views

Attempting to generate a heat map like in this figure [closed]

I have a data frame ...
Exhausted's user avatar
  • 1,801
1 vote
1 answer
53 views

A box plot of qualitative variables

I have 2 groups of patients; responders to chemotherapy and non-responders I have calculated cancer cell fraction (CCF) of a set of driver genes (by variant allele frequency) for each group and I ...
Exhausted's user avatar
  • 1,801
0 votes
1 answer
79 views

Griding ggplot object in r

I have this data frame head(d) ...
Exhausted's user avatar
  • 1,801
-1 votes
1 answer
136 views

Showing name of genes in boxplot

I have a long format data frame like this ...
Exhausted's user avatar
  • 1,801
0 votes
2 answers
81 views

Clustered column chart for single cell data

I want to create a column plot for my single cell analysis that has 2 sample types, a normal and PDAC. I want to show, the percentage of different cell types per sample type. How do I go about ...
mmpp's user avatar
  • 361
1 vote
1 answer
1k views

Visualizing the difference among three groups

I have 3 data frames for three groups of patients and in each of them I have the number of mutation types like insertion, deletion, SNP and total of mutations for each patients. In each group I have ...
Exhausted's user avatar
  • 1,801
0 votes
2 answers
974 views

Making a volcano plot look less cluttered

I have generated a volcano plot with a differential expression file. Code for inputing file: ...
mmpp's user avatar
  • 361
0 votes
1 answer
149 views

Bar plot with error bars

I am trying to plot a box plot/stacked bar graph with error bars. output of dput(DF) ...
mmpp's user avatar
  • 361
0 votes
1 answer
55 views

Dodged bar chart

I want to create a dodged barchart with different cell cycles for each cell type within each condition. dput(DF_count) ...
mmpp's user avatar
  • 361
2 votes
1 answer
2k views

Pulling out a certain gene in a volcano plot

I have generated a volcano plot with a differential expression file. Code for inputing file: ...
mmpp's user avatar
  • 361
0 votes
1 answer
7k views

stacked bargraph with error bars

I'm attempting to plot a stacked barplot with ggplot2 with this code: ...
user6810's user avatar
-1 votes
2 answers
458 views

Making a boxplot or violinplot for several dataframe with different number of samples

I have 3 data frames for treatment of 3 different drugs and in each of them I have the number of mutation types like insertion, deletion, SNP and total of mutations for each patients. In each group I ...
Exhausted's user avatar
  • 1,801
0 votes
1 answer
474 views

Stacked barplot for single cell analysis

I want to create a stacked bar-graph with different cell cycles for each cell type within each condition. I have uploaded the file for it. Don't know how to go about it as now I have another condition ...
user6774's user avatar
0 votes
3 answers
157 views

Boxplot of read length distributions from multiple samples

Newbie R user here. I want to create a plot with boxplots of read length distribution on the Y-axis, and samples on the X-axis -- like this image from doi: 10.1038/srep16498 However, I'm not sure ...
Lasio's user avatar
  • 3
7 votes
1 answer
2k views

Density plot, scale it to 0-1

Doubt regarding density plot what is the scale being plotted in the Y axis.Is it possible to scale it to 1?. This is my code ...
kcm's user avatar
  • 1,694
0 votes
1 answer
5k views

Seurat VlnPlot presenting expression of multiple genes in a single cluster

Seurat VlnPlots are most commonly used to visualize differences in any given gene expression across multiple clusters or cell types. For example: ...
zdebruine's user avatar
  • 149