`violin` trace: why an area is calculated if all values are 0?
See original GitHub issuePlease see my question in stackoverflow
I have an array of values from 0-10 with and 20 groups in each. For some groups or categories all values are 0. When I use violin plot, there is an area calculated which is below 0, but I want to get thedifferent that I got from Seurat package VlnPlot. Is there a way to overcome that problem? Here is a part of java script code:
var my_violin = [];
var vln_layout = {};
var my_violin =[
{
type:"violin",
x:xvalues,
y:my_categories,
points:"all",
pointpos:0,
color:"black",
width:0.75,
marker:{color:"black",size:4},
jitter:1,
span:0,
transforms:[
{
type:"groupby",
groups:my_categories,
styles:my_styles
}
]
}
]
var vln_layout = {title: "my title", xaxis:{showline: false,showgrid: false,zeroline: false,
categoryorder: 'category ascending'}, yaxis: {showline: false,showgrid: false,zeroline:false},
showlegend:true,legend:{traceorder:'normal',categoryorder:"ascending"}};
Plotly.newPlot('myDiv2', my_violin, vln_layout, {showSendToCloud: false});
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
plotly.js: why an area is calculated if all values are 0?
I have an array of values from 0-10 with and 20 groups in each. For some groups or categories all values are 0....
Read more >JavaScript Figure Reference: violin Traces - Plotly
Sets the width of the violin in data coordinates. If "0" (default value) the width is automatically selected based on the positions of...
Read more >Violin plot — geom_violin • ggplot2
If "count", areas are scaled proportionally to the number of observations. If "width", all violins have the same maximum width. If FALSE ,...
Read more >A Complete Guide to Violin Plots | Tutorial by Chartio
Violin plots are used to compare the distribution of data between groups. ... In a KDE, each data point contributes a small area...
Read more >Hypothetical Outcome Plots Outperform Error Bars and Violin ...
The width of the colored area at each level shows how many vials of sea ... all such values are rounded up to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think we can do that, whatever size we choose someone will come up with a data set that has a natural size smaller than that. It has to actually have zero size, even if that means a special case with its own drawing code.
Trying to plot datasets
[0,0,0,0]
(left) and[0,0,0,1]
(right) with violins:using seaborn:
using plotly.js: https://codepen.io/antoinerg/pen/oVGxvN
Thanks @micosacak for reporting this issue!