Issue Plotting x and y coordinates
Mostra commenti meno recenti
I'm trying to do produce a simple plot in matlab using the the following code:
Prob_det = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0];
Prob_FalseAlarm = [1.0,1.0, 0.96, 0.8, 0.5, 0.22, 0.13, 0.06, 0.01, 0.0];
plot(Prob_FalseAlarm, Prob_det)
I'm hoping to see a plot that contains the 10 points from x and y, however, all I'm seeing is a straight line at 1 on the y axis.
Risposte (1)
Rik
il 2 Feb 2018
You see a line, because the standard format for plot is a blue line going straight from one point to the next. You can look in the documentation for other formatting options.
plot(Prob_FalseAlarm, Prob_det,'*-r')
%this will plot a continuous red line with each point marked by an asterisk
3 Commenti
Tellrell White
il 2 Feb 2018
Walter Roberson
il 2 Feb 2018
plot(Prob_FalseAlarm, Prob_det,'*r')
Star Strider
il 2 Feb 2018
Perhaps this:
Prob_det = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0];
Prob_FalseAlarm = [1.0,1.0, 0.96, 0.8, 0.5, 0.22, 0.13, 0.06, 0.01, 0.0];
xv = linspace(0, 1, numel(Prob_det));
figure
plot(xv, Prob_det, 'pg', xv, Prob_FalseAlarm,'pr')
grid
axis([0 1 0 1.1])
legend('Prob\_det', 'Prob\_FalseAlarm', 'Location','E')
Categorie
Scopri di più su Annotations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!