How to plot lines of different colors

Ok so lets say I have a plot and I want to give it a unique color just for fun. plot(x,y,'z.-'); where z is the color I want to use. I've heard about some things like rgb codes. I've looked them up, tried them, tried them again dividing by 255 to get decimals, and nothing works for me.
ex: plot(x,y,'Color',[123,123,123],'.-');
What do I do?

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 9 月 5 日

0 投票

plot(x, y, '.-', 'Color', [123, 123, 123])
or
plot(x, y, 'Color', [123, 123, 123], 'LineStyle', '.-')

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

2013 年 9 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by