Vertically stacked histograms or violin plots or density estimators for 14 variables
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I am looking to create a figure similar to the attached. Where X axis is 0:100 and y axis has the string name to each variable. I would like the 'height' of each variable to represent the frequency of the value. Before this I have visualised the data through box plots, but now want to view the density of each variable by exploring figures similar to below and/or violin plots. Any help or advice would be greatly appreciated.
% code
figure(1)
boxplot(mDATA)
ylabel('% of cycle')
ylim([0 100])
xticklabels(names)
view([90 -90])
X = mDATA(:,1);
figure(2)
histfit(X)
hold on
[f,Xi] = ksdensity(X);
plot(Xi,f);
hold off
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193602/image.png)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!