Boxplot with groups and overlaid with scatter data
8 次查看(过去 30 天)
显示 更早的评论
Hello all,
I am having some trouble overlaying scatter data onto box plots when both the scatter and box data are grouped by categorical data.
Here's a summary of the issue:
I have data that is grouped by two different variables (lets call them A and B). Each of the variables have different categorical data.
A has 3 categories (A1, A2 and A3), while B has 6 (B1:B6). As you can imagine, not all the groups of A have accompanying data matching the "sub-group" B. For instance, there is no overlap between A1 and B4 (which is okay in my dataset).
Now I am able to create a boxplot of my data grouped A1 and B and get five box categories.
Similarly, I am able to plot the scatter data and get 5 scatter categories.
The issue arises when I attempt to overlap the data (ie. hold on/off).
As you can see, categories 1,2 and 3 overlap properly, but the others do not. I have a workaround in mind for "fixing" this which involves pretty much re-indexing my categories from (1:5) with command loops for both plots but I imagined there may be a better way to do this if I ask the experts on here.
Please let me know if any additional information is needed to help.
Thanks.
2 个评论
Adam Danz
2020-10-22
Can't you just rename the categories 6 and 7 of the scatterplot data to match categories 5 & 6 of the boxplot data?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!