<p>I'm not quite sure what you mean.  You can alter the % of height that the bottom part of the graph takes up, that will make all the vertical bar parts proportionately taller, but I don't think you should because you have so many groups to display in the bottom part.</p>
<p>I think what you'd want to do is to alter the y-axis so that it stops being totally proportional, to compress the size of the tallest bar, so you can better see the difference in bar sizes between the other comparisons?</p>
<p>I'm not sure you can do that.  Making the y axis logged with &quot;scale.intersections&quot; might help.</p>
<p>You'd probably be best off making a second graph that omits that &quot;common to all&quot; intersection.  Once that is out of the picture, the difference between the others will be more visible.</p>

CC BY-SA 4.0
2022-12-04T19:47:55.867Z
2022-12-04T19:47:55.867Z
swbarnes2
<p>I have tried to use UpsetR to visualize the input file which can be found <a href="https://cloudstor.aarnet.edu.au/plus/s/OupXC8rF2bDFtRV" rel="nofollow noreferrer">here</a>.</p>
<p><a href="https://i.sstatic.net/P2RAE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/P2RAE.png" alt="enter image description here" /></a></p>
<pre class="lang-r prettyprint-override"><code>library(&quot;UpSetR&quot;)
orthogroups_df&lt;- read.table(&quot;orthogroups.GeneCount.tsv&quot;,  header=T, stringsAsFactors = F)

#All species
selected_species &lt;- colnames(orthogroups_df)[2:(ncol(orthogroups_df) -1)] 
selected_species
 [1] &quot;Atha&quot; &quot;Cann&quot; &quot;NQLD&quot; &quot;Natt&quot; &quot;Ngla&quot; &quot;Nlab&quot; &quot;Nsyl&quot; &quot;Ntab&quot; &quot;Ntom&quot; &quot;Slyc&quot; &quot;Stub&quot; &quot;Vvin&quot;

head(orthogroups_df)
  Orthogroup Atha Cann NQLD Natt Ngla Nlab Nsyl Ntab Ntom Slyc Stub Vvin Total
1  OG0000000    0    0  965    0    0    3    0    0    0    0    0    0   968
2  OG0000001    0    1    3    0    0  448    0    0    0    0    0    0   452
3  OG0000002    0    1  313    0    0  120    1    0    1    0    0    0   436
4  OG0000003    0   93   15   21   46   16   33   63   36   25   39   26   413
5  OG0000004    1   42    2   34  109    6    8  154   11    9    4    0   380
6  OG0000005    0    2   61    1   34   44   91   70   43   20    1    0   367

ncol(orthogroups_df)
[1] 14

orthogroups_df[orthogroups_df &gt; 0] &lt;- 1
# we only show intersections of interest
intersections=list(list(selected_species),
                   list(&quot;Nlab&quot;, &quot;NQLD&quot;, &quot;Ngla&quot;), 
                   list(&quot;Nlab&quot;, &quot;NQLD&quot;, &quot;Nsyl&quot;), 
                   list(&quot;Nlab&quot;, &quot;Ngla&quot;, &quot;Nsyl&quot;), 
                   list(&quot;NQLD&quot;, &quot;Nsyl&quot;, &quot;Ngla&quot;))
upset(orthogroups_df, 
      text.scale = c(1.4, 1.4, 1.4, 1.4, 1.4, 1.4),
      sets=rev(selected_species), 
      nsets = ncol(orthogroups_df),
      #keep.order=T, 
      #mb.ratio=c(0.5,0.5), 
      #order.by='degree', 
      #order.by='freq',
      intersections = intersections, 
      sets.x.label=&quot;Total nbr of orthogroups&quot;, 
      mainbar.y.label = &quot;Nbr of orthogroups&quot;, 
      #empty.intersections = &quot;on&quot;, 
      group.by = &quot;intersections&quot;)
</code></pre>
<p>How is possible to make the bar bigger of the double digits values or is a way to rotate the plot?</p>

<r><ggplot2><upsetr>
How to make bar bigger in UpsetR plot
# How to make bar bigger in UpsetR plot

(Asked by: username_0 on 2022-12-02)

I have tried to use UpsetR to visualize the input file which can be found here.

library("UpSetR")
orthogroups_df<- read.table("orthogroups.GeneCount.tsv",  header=T, stringsAsFactors = F)

#All species
selected_species <- colnames(orthogroups_df)[2:(ncol(orthogroups_df) -1)] 
selected_species
 [1] "Atha" "Cann" "NQLD" "Natt" "Ngla" "Nlab" "Nsyl" "Ntab" "Ntom" "Slyc" "Stub" "Vvin"

head(orthogroups_df)
  Orthogroup Atha Cann NQLD Natt Ngla Nlab Nsyl Ntab Ntom Slyc Stub Vvin Total
1  OG0000000    0    0  965    0    0    3    0    0    0    0    0    0   968
2  OG0000001    0    1    3    0    0  448    0    0    0    0    0    0   452
3  OG0000002    0    1  313    0    0  120    1    0    1    0    0    0   436
4  OG0000003    0   93   15   21   46   16   33   63   36   25   39   26   413
5  OG0000004    1   42    2   34  109    6    8  154   11    9    4    0   380
6  OG0000005    0    2   61    1   34   44   91   70   43   20    1    0   367

ncol(orthogroups_df)
[1] 14

orthogroups_df[orthogroups_df > 0] <- 1
# we only show intersections of interest
intersections=list(list(selected_species),
                   list("Nlab", "NQLD", "Ngla"), 
                   list("Nlab", "NQLD", "Nsyl"), 
                   list("Nlab", "Ngla", "Nsyl"), 
                   list("NQLD", "Nsyl", "Ngla"))
upset(orthogroups_df, 
      text.scale = c(1.4, 1.4, 1.4, 1.4, 1.4, 1.4),
      sets=rev(selected_species), 
      nsets = ncol(orthogroups_df),
      #keep.order=T, 
      #mb.ratio=c(0.5,0.5), 
      #order.by='degree', 
      #order.by='freq',
      intersections = intersections, 
      sets.x.label="Total nbr of orthogroups", 
      mainbar.y.label = "Nbr of orthogroups", 
      #empty.intersections = "on", 
      group.by = "intersections")

How is possible to make the bar bigger of the double digits values or is a way to rotate the plot?

**Tags:** r, ggplot2, upsetr

---

## 1 answers

### Answer by username_1 on 2022-12-04. Score: 1

I'm not quite sure what you mean. You can alter the % of height that the bottom part of the graph takes up, that will make all the vertical bar parts proportionately taller, but I don't think you should because you have so many groups to display in the bottom part.

I think what you'd want to do is to alter the y-axis so that it stops being totally proportional, to compress the size of the tallest bar, so you can better see the difference in bar sizes between the other comparisons?

I'm not sure you can do that. Making the y axis logged with "scale.intersections" might help.

You'd probably be best off making a second graph that omits that "common to all" intersection. Once that is out of the picture, the difference between the others will be more visible.


---

