フィルターのクリア

Plotting with arrays, no graph displayed

1 回表示 (過去 30 日間)
Grace
Grace 2023 年 3 月 12 日
コメント済み: Star Strider 2023 年 3 月 12 日
x = [6000,9375];
y = 10;
plot(x,y,'red')
title('x by y')
xlabel('x')
ylabel('y')

採用された回答

Star Strider
Star Strider 2023 年 3 月 12 日
Plotting one point requres a marker, and plotting a line requires at least two vectors of the same size.
Two options, depending on the result you want —
x = [6000,9375];
y = 10;
figure
plot(x,y,'pr')
title('x by y')
xlabel('x')
ylabel('y')
x = [6000,9375];
y = 10*ones(size(x));
figure
plot(x,y,'red')
title('x by y')
xlabel('x')
ylabel('y')
And of course, you can plot both markers and lines of various kinds connecting them.
.
  2 件のコメント
Grace
Grace 2023 年 3 月 12 日
Thank for your answer, it is very helpful
Star Strider
Star Strider 2023 年 3 月 12 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by