필터 지우기
필터 지우기

How to plot Multiple trend-lines on one scatter plot

조회 수: 19 (최근 30일)
Nicky T
Nicky T 2020년 9월 13일
댓글: Nicky T 2020년 9월 14일
Hi every one,
I have a scatter plot and I need to do a second order trend line for some part of my data (just for the values less than 15 or 10 on x axis). Do you know how can I do that?

답변 (1개)

KSSV
KSSV 2020년 9월 13일
편집: KSSV 2020년 9월 14일
You can pick those respective points and fit a curve to plot the trend. Let x,y be your points.
x1 = x(x<=15) ; % pick points less than 15
y1 = y(x<=15) ;
p1 = polyfit(x1,y1,1) ; % Fit a line
figure
hold on
plot(x,y,'.k')
plot(x1,polyval(p1,x1),'r')
  댓글 수: 11
KSSV
KSSV 2020년 9월 14일
What are values of tRet, tSupp ??
Nicky T
Nicky T 2020년 9월 14일
those are temperature. I have an excel file with lots of data.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by