Change the color of one point on a plot

7 ビュー (過去 30 日間)
Bill Symolon
Bill Symolon 2017 年 2 月 15 日
コメント済み: Bill Symolon 2017 年 2 月 15 日
I'm trying to plot several data points on the same plot: a matrix of points, a regression line and a manual point. I would like to change the color of the manual point from the default color to black. The manual point is at 36 1. Everything in the code works and the manual point plots green. When I add the 'b' command to line 7 below, I get errors. Thanks for your help.
if true
z = sortrows(historicalDamage);
x = z(:,1);
y = z(:,2);
b = glmfit(x,y,'binomial','link','logit');
yfit = glmval(b,30:90,'logit');
subplot(2,1,2);
plot(x, y, 'o', 30:90, yfit, '-', 36, 1, 'o', 'b', 'LineWidth', 2);
title('Logistic Model Regression Curve')
xlabel('Ambient Temperature (°F)')
ylabel('Probability of Damage')
ylim([-0.5 1.5])
legend('Observed Failures', 'Logistic Model', 'Temp at Failied Launch (36 °F)');
end

採用された回答

Walter Roberson
Walter Roberson 2017 年 2 月 15 日
plot(x, y, 'o', 30:90, yfit, '-', 36, 1, 'ok', 'LineWidth', 2);
  1 件のコメント
Bill Symolon
Bill Symolon 2017 年 2 月 15 日
That did it, thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by