# Why are these violin plots "clipped"?

**URL:** https://discourse.julialang.org/t/why-are-these-violin-plots-clipped/103006
**Category:** Visualization
**Tags:** plotting, plots, statsplots
**Created:** [August 20, 2023, 4:07pm UTC](https://discourse.julialang.org/t/why-are-these-violin-plots-clipped/103006 "2023-08-20T16:07:17Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![maxkapur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxkapur/32/21208_2.png) [@maxkapur](https://discourse.julialang.org/u/maxkapur)
#### Post date: [August 20, 2023, 5:59pm UTC](https://discourse.julialang.org/t/why-are-these-violin-plots-clipped/103006/2 "2023-08-20T17:59:16Z")

</div>

Violin plots are always clipped (I think to the range of the input data, or maybe plus some margin?), because the function that defines the curve is the sum of Gaussian distributions, which have full support.

The clipping is more obvious for data like yours that is not well approximated by a normal distribution.

Python does the same thing:

```python
import matplotlib.pyplot as plt
plt.violinplot([[3, 3, 3, 3, 7, 7, 7, 7], [2, 2, 4, 4]])

```

![violin](https://global.discourse-cdn.com/julialang/original/3X/4/0/40b2e6faf0cc39aa0cbdf82667e021f06200695c.png)

As your script doesn’t include the import statements, I can’t tell which plotting library you are using, but check the documentation for the `violin!` function to see if there is a scale parameter that will let you reduce the standard deviation of the Gaussians. That will create a less visible clipped appearance.

---

_[View the full topic](https://discourse.julialang.org/t/why-are-these-violin-plots-clipped/103006)._
