text: user4595: I want to have a jitter violin coloured by sample ids but I get this weird plot
  > str(long)
  Classes ‘data.table’ and 'data.frame':  156 obs. of  3 variables:
   $ gene    : chr  "gene2" "gene3" "gene4" "gene1" ...
   $ variable: chr  "1016" "1016" "1016" "1016" ...
   $ value   : num  5.82 8.41 11.22 7.21 5.61 ...
   - attr(*, ".internal.selfref")=<externalptr> 
  >
  
  > p <- ggplot(long, aes(x=gene, y=value,colour=variable))
  > p + geom_violin(width = 1.3) + geom_quasirandom(alpha = 0.2, width = 0.2)+ theme_classic()
  There were 21 warnings (use warnings() to see them)
  
  
  I can not figure out where I am doing something wrong that I get this instead of getting a proper violin plot by dots coloured with sample IDs
  
  user73: What happens if you group by gene?
  > long |>
    ggplot() +
    aes(x=gene, y=value, colour=variable, group=gene) +
    geom_violin(width = 1.3) +
    geom_quasirandom(alpha = 0.2, width = 0.2) +
    theme_classic()
  
  @llrs raised an insightful point in their comment. There's a good chance that the "weird plot" that you see is a side effect of trying to display individual "grouped-by-variable" boxplots that have too little data. Without knowing what you would like the boxplot to look like, it's hard to create something to improve the presentation.
  
original_text: 4595: <p>I want to have a jitter violin coloured by sample ids but I get this weird plot</p>
  <pre><code>&gt; str(long)
  Classes ‘data.table’ and 'data.frame':  156 obs. of  3 variables:
   <span class="math-container">$ gene    : chr  "gene2" "gene3" "gene4" "gene1" ...
   $</span> variable: chr  &quot;1016&quot; &quot;1016&quot; &quot;1016&quot; &quot;1016&quot; ...
   $ value   : num  5.82 8.41 11.22 7.21 5.61 ...
   - attr(*, &quot;.internal.selfref&quot;)=&lt;externalptr&gt; 
  &gt;
  
  &gt; p &lt;- ggplot(long, aes(x=gene, y=value,colour=variable))
  &gt; p + geom_violin(width = 1.3) + geom_quasirandom(alpha = 0.2, width = 0.2)+ theme_classic()
  There were 21 warnings (use warnings() to see them)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/cMycr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cMycr.png" alt="enter image description here" /></a></p>
  <p>I can not figure out where I am doing something wrong that I get this instead of getting a proper violin plot by dots coloured with sample IDs</p>
   73: <p>What happens if you group by gene?</p>
  <pre><code>&gt; long |&gt;
    ggplot() +
    aes(x=gene, y=value, colour=variable, group=gene) +
    geom_violin(width = 1.3) +
    geom_quasirandom(alpha = 0.2, width = 0.2) +
    theme_classic()
  </code></pre>
  <p>@llrs raised an insightful point in their comment. There's a good chance that the &quot;weird plot&quot; that you see is a side effect of trying to display individual &quot;grouped-by-variable&quot; boxplots that have too little data. Without knowing what you would like the boxplot to look like, it's hard to create something to improve the presentation.</p>
  