how to plot a line graph between a set of values against a single value

조회 수: 4 (최근 30일)
uma
uma 2022년 7월 20일
답변: KSSV 2022년 7월 20일
I have the values of c1 c2 and accuacy . At c1=-5,c2=-7 my model accuracy is 0.81 respectively. The data is given below now my question is how to draw a line graph for this data.
c1 c2 Accuracy
-5 -7 0.81
-7 -4 0.96
-4 3 0.94
-1 6 0.87
5 -3 0.84
3 -1 0.75
9 5 0.82

답변 (1개)

KSSV
KSSV 2022년 7월 20일
data = [-5 -7 0.81
-7 -4 0.96
-4 3 0.94
-1 6 0.87
5 -3 0.84
3 -1 0.75
9 5 0.82] ;
c1 = data(:,1) ;
c2 = data(:,2) ;
Acc = data(:,3) ;
c1(end+1) = NaN ;
c2(end+1) = NaN;
c = [Acc ;NaN];
figure
patch(c1,c2,c,'EdgeColor','interp','Marker','o','MarkerFaceColor','flat');
colorbar;

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by