how to represent the purple color by a string value

593 ビュー (過去 30 日間)
jaah navi
jaah navi 2019 年 2 月 22 日
編集済み: John D'Errico 2019 年 2 月 22 日
There are 8 colors that can be specified by a string value: 'r','g','b','c','m','y','k','w'.
How to specify the maroon,olive,purple color by a string value.

回答 (1 件)

John D'Errico
John D'Errico 2019 年 2 月 22 日
編集済み: John D'Errico 2019 年 2 月 22 日
You can't. MATLAB offers those string options for colors. If you want to set a specific color, you can, but as a numeric vector of length 3. You need to provide RGB code values.
For example, for a purple of sorts, you might do this:
H = surf(rand(10));
H.FaceColor = [.5 0 .5];
Not my favorite color scheme, but it is purple. And, for an olive, you might try something like this:
H.FaceColor = [.3 .4 .2];
You get the idea.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by