You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for this great function!
I have an issue as I want to use violinplot to display two groups of data (let's call them vectors A and B) that have unequal number of datapoints (n=24 and n=23). Because of this, the call to the script (violinplot([A,B],{'A','B'})) doesn't work with the following error message "Error using vertcat: Dimensions of arrays being concatenated are not consistent."
I thought that the best would be to enter the data in 2 steps with one call to violinplot for each dataset, however, since there is nowhere to specify the X coordinates, it doesn't seem possible. Would you have some recommendation about how to do? I guess one should go to use violin directly but would it be possible to add the possibility to specify the X coordinates within violinplot?
The text was updated successfully, but these errors were encountered:
Hi @NicolasClairis
If you just want to plot two violins with unequal data sizes, that should work by default.
If what you want to do is to compare these violinplots, i.e. plot them side by side, my recommendation would be to call directly to Violin.m skipping the violinplot.m function. Please, check the readme file, on how to call the violin function directly or check this issue #49 (comment) where this is already described.
Dear @mikelgg93 thanks a lot for the very fast answer! I digged a bit in the previous issues but missed this one apparently so thanks for pointing it!
I just figured it out after a bit of struggling indeed. In the end I just replaced violinplot([A,B],['A_name','B_name'})
by the following code: violin({A},1); violin({B},2); xticks(1:2); xticklabels({'A_name','B_name'});
it's a bit longer but it seems to work. If this could be implemented directly within violinplot that would be quite practical though but anyway, I'm happy it works with not so much trouble in the end!
Thanks a lot for this great function!
I have an issue as I want to use violinplot to display two groups of data (let's call them vectors A and B) that have unequal number of datapoints (n=24 and n=23). Because of this, the call to the script (violinplot([A,B],{'A','B'})) doesn't work with the following error message "Error using vertcat: Dimensions of arrays being concatenated are not consistent."
I thought that the best would be to enter the data in 2 steps with one call to violinplot for each dataset, however, since there is nowhere to specify the X coordinates, it doesn't seem possible. Would you have some recommendation about how to do? I guess one should go to use violin directly but would it be possible to add the possibility to specify the X coordinates within violinplot?
The text was updated successfully, but these errors were encountered: