How to save a plot with multiple overlays as a single variable and/or plot the regression for all points as one line?

2 次查看(过去 30 天)
I have multiple samples in each graph that i have overlahyed using the hold on function, i am looking to find the regression for all points on the final overlayed scatter plot!
hold off
t = tiledlayout(1,2)
ax1 = nexttile
%Cre+
hold on
scatter(t1.D,t1.CC)
scatter(t6.D,t6.CC)
scatter(t8.D,t8.CC)
scatter(t9.D,t9.CC)
scatter(t12.D,t12.CC)
xlim([0 1000])
ylim([250 6000])
title('Cre-')
ylabel('Area(pixels^2)')
xlabel('Distance from nearest Sinus edge (pixels x 10^3)');
ax2 = nexttile
% Cre-
hold on
scatter(t4.D,t4.CC)
scatter(t5.D,t5.CC)
scatter(t10.D,t10.CC)
scatter(t11.D,t11.CC)
scatter(t13.D,t13.CC)
xlim([0 1000])
ylim([250 6000])
title('Cre-')
ylabel('Area(pixels^2)')
xlabel('Distance from nearest Sinus edge (pixels x 10^3)');
Thanks!

回答(1 个)

KSSV
KSSV 2021-7-22
Read about function regression to get the regression value and read about plotregression to get the regression plot.

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by