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

1 Ansicht (letzte 30 Tage)
uma
uma am 20 Jul. 2022
Beantwortet: KSSV am 20 Jul. 2022
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

Antworten (1)

KSSV
KSSV am 20 Jul. 2022
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;

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by