>> A = [2 2 4 4];
>> B = [5 3 3 5];
>> fill(A,B,"blue");
Above produces expected result
>> fill(A,B,"#0000FF");
"Error using fill
Invalid color, marker, or line style."
But using "#0000FF" or any hexadecimal color throws an error. Why? Using version R2023a

 채택된 답변

Voss
Voss 2024년 4월 26일
A = [2 2 4 4];
B = [5 3 3 5];
patch("XData",A,"YData",B,"FaceColor","#0000FF");

댓글 수: 2

Voss
Voss 2024년 4월 26일
편집: Voss 2024년 4월 26일
A = [2 2 4 4];
B = [5 3 3 5];
fill(A,B,"","FaceColor","#0000FF");
Voss' suggestion is good. Another approach: hex2rgb
fill(A,B,hex2rgb("#0000FF"))

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

제품

릴리스

R2023a

질문:

2024년 4월 26일

댓글:

2026년 3월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by