Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
truncated violin plots #1494
@phobson Do you have an idea what the warning might mean?
@ricky-r Can you provide a reproducible example, with real or made up data?
Is this with default settings or did you set any options?
It looks strange to me that the violins are not smooth in this case.
My guess is that matplotlib thinks (and I agree) that setting an aspect ratio on an axes is ambiguous if the scales aren't the same.
If I had to guess, the funky drawing and warning are unrelated. What you're seeing here might a result of the KDE reaching down into negative values. Like josef said, a working example would help greatly.
If the kde has negative values, then we would need an option for users to truncate the violin instead of using the full default range.
possible enhancement to kde:
Ok guys, it was a lot simpler than what I thought. I went through the data that I'm plotting and found out that whenever my values included a zero, the corresponding violin plots had the behaviour in the figure above. In any case the boxplot was correct, just the area around it (the violin plot) got messed up a bit.
I have no problem removing these values from my dataset, so no big deal. I'll make a wild guess here: does matplotlib remove all zeros by default when in log scale?
(The warning was indeed unrelated to this issue. Nothing appears when I plot the same data in interactive mode)