Iris coloring histogram hold on
5 次查看(过去 30 天)
显示 更早的评论
Hi,
How can I perform such task concering iris dataset?
Now plot histograms of all variables coloring them by species. Use hold on to overlay plots for different datasets on one figure. Which variables separate species well?
Thanks
4 个评论
Cris LaPierre
2023-1-10
编辑:Cris LaPierre
2023-1-10
Walter gives a simple example below. If you want a quick introduction to plotting in MATLAB, consider going through Ch 9 of MATLAB Onramp. It doesn't cover histograms specifically, but does show you how to call plotting functions, including adding multiple plots to the same axes. It should take about 10-15 mins to complete.
If you find that helpful, you might consider going through some of the other chapters as well. Is a nice, free way to learn the fundamentals of MATLAB.
采纳的回答
Walter Roberson
2023-1-10
x1 = rand(1,100);
x2 = rand(1,100).^2 + 0.1;
x3 = exp(rand(1,100));
histogram(x1);
hold on
histogram(x2);
histogram(x3);
hold off
legend({'x1', 'x2', 'x3'})
更多回答(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!