-
-
Notifications
You must be signed in to change notification settings - Fork 544
Joyplot Doc #1090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Joyplot Doc #1090
Conversation
Not having luck with violin plots...I am going to try building from scratch. Could be a fun FF. |
what's not working with violin plots? Groups as 'y', orientation='h', make them half... |
I'm having trouble allowing them to overlap. |
Right, they won't overlap... We could just generalize violin to allow it, rather than wrap a whole subplot-based infrastructure onto it... @etpinard ? |
I'd like to take a first stab at adding that feature if we decide to go that route |
Continuing off @nicolaskruchten 's point, the violins will not be able to overlap because If we place violins at y=0, 0.2, and 0.6 and Nudging the 0.6 violin very close to 0.2 (0.21) If we allowed negative numbers for Setting There is an issue of the violins getting cut off by the frame, but we can fix this. CODE FOR EXAMPLE: var data = [
{
type: 'violin',
x: [0, 5, 7, 8],
points: 'none',
box: {
visible: false
},
boxpoints: false,
line: {
color: 'black'
},
fillcolor: '#8dd3c7',
opacity: 0.6,
meanline: {
visible: false
},
y0: 0
},
{
type: 'violin',
x: [0, 4, 7, 8],
points: 'none',
box: {
visible: false
},
boxpoints: false,
line: {
color: 'black'
},
fillcolor: '#d3c78d',
opacity: 0.6,
meanline: {
visible: false
},
y0: 0.2
},
{
type: 'violin',
x: [0, 4, 7, 8],
points: 'none',
box: {
visible: false
},
boxpoints: false,
line: {
color: 'black'
},
fillcolor: '#c78dd3',
opacity: 0.6,
meanline: {
visible: false
},
y0: 0.21
}
];
var layout = {
title: "Basic Horizontal Violin Plot",
xaxis: {
zeroline: false
},
violingap: 0
};
Plotly.newPlot('graph', data, layout); @etpinard WDYT of this approach? |
Ok, and what's wrong again with something like: https://codepen.io/etpinard/pen/VGOQad?editors=1010 |
I should have made them half violins to demonstrate the point more clearly. In the example you shared, I want to take the top blue one for example and shift it down a few pixels so that its middle line is somewhere between 1 and 2, while leaving the rest looking the same. |
tweaking the |
I swapped all the y values of orange violin at 2 to 1.8 and get this: https://codepen.io/plotly/pen/yRXjPe Can you see how the violins are now all thinner and I was not able to just shove that one violin down by a certain number of pixels? |
Thanks for codePen @Kully ! Would something like https://codepen.io/etpinard/pen/yRogaq be ok? If not, we could add a Allowing |
I like this idea. |
vote to close... will be covered in the v4 docs |
for Issue: #1018