Why can't I make a boxplot with data overlay?

Illustration
Brenno Selli - 2023-10-21T14:59:38+00:00
Question: Why can't I make a boxplot with data overlay?

Here we go... So, I have the following boxplot, the values on the X-axis are spaced by 1, which is fine and I understand why, but I need to find a way to do the same boxplot, but with each box at its own value and scale even if there is box overlaps. Is there a way to do this?    

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

The following is an example:

 

% Sample data
x = [ones(100,1); 2*ones(100,1); 4*ones(100,1)];
y = rand(300,1)+x;

% Draw box plot for each x-value position
figure
boxchart(x,y)

 I make a boxplot with data overlay

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!