# MATLAB: Connecting points between two box plots

boxplotconnectingnotboxplot

Hello everyone,
I attached a picture of what I'm trying to plot to make it clear. I'm using the function notBoxPlot to create these "boxplots" and now I'd like to connect each point from the first boxplot to its counterpart in the second and third boxplot. I was told that I can use the command "line", however I could not figure it out despite reading the documentation and questions about connecting points (none of them seem to fit my problem).
I tried this for two boxplots but it does not yield any connecting lines at all. The vectors y1 and y2 are simply column vectors with 30 numbers each.
y1 = [CSPlus_shock]y2 = [CSPlus_noshock]notBoxPlot([y1,y2],[1:2])hold on
line(y1,y2)

% Some pretend dataN = 5;x = [randn(N,1); 100+randn(N,1)]; % 5 points toward the left of the plot, and 5 toward the righty = sort(randn(2*N,1));% Scatter plot, and then connect each marker on the left% to corresponding one on the rightfigurescatter(x,y)line([x(1:N) x(N+1:end)]',[y(1:N) y(N+1:end)]')
line([2x5 array of x points],[2x5 array of y points])
% Some pretend dataN = 5;x = [randn(N,1); 100+randn(N,1)];y = sort(randn(2*N,1));% Scatter plot, and then connect *one* marker on the left% to corresponding one on rightfigurescatter(x,y)line([x(1) x(N+1)]',[y(1) y(N+1)]')
line([3x5 array of x points],[3x5 array of y points])