フィルターのクリア

Error using patch not enough input arguments

9 ビュー (過去 30 日間)
Anas Khan
Anas Khan 2022 年 10 月 29 日
コメント済み: Anas Khan 2022 年 10 月 29 日
I created 2 custom colors
>> myGreen
myGreen =
0.0863 0.7294 0.7294
>> myOrange
myOrange =
0.9216 0.8157 0.1294
I am trying to use them in patch like this:
patch([x fliplr(x)], [yMean-ySEM fliplr(yMean+ySEM)],'FaceColor',myGreen,'FaceAlpha',0.2,'EdgeColor','none')
I have 3 arguments: x, y, and color. Why does it give this error?
Error using patch
Not enough input arguments.

採用された回答

Star Strider
Star Strider 2022 年 10 月 29 日
編集済み: Star Strider 2022 年 10 月 29 日
The 'FaceColor' name-value pair is not necessary in patch calls. Just use the designated colour or RGB triplet as the third argument (that patch considered to be missing here) —
myGreen = [0.0863 0.7294 0.7294];
myOrange = [0.9216 0.8157 0.1294];
x = 1:10;
yMean = rand(size(x));
ySEM = rand(size(x));
figure
patch([x fliplr(x)], [yMean-ySEM fliplr(yMean+ySEM)],myGreen,'FaceAlpha',0.2,'EdgeColor','none')
EDIT — (29 Oct 2022 at 18:24)
Corrected typographical error.
.

その他の回答 (1 件)

Jan
Jan 2022 年 10 月 29 日
編集済み: Jan 2022 年 10 月 29 日
Omit all parts of the command, which are not mandatory:
patch([x fliplr(x)], [yMean-ySEM fliplr(yMean+ySEM)])
Now compare this with the list of valid inputs taken from: doc patch:
Your call does not match one of them.
  1 件のコメント
Anas Khan
Anas Khan 2022 年 10 月 29 日
Thanks did not know MatLab would read my RGB triplet and understand it to be color.

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

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by