How can I choose both the color and shape of a line plotted and how it is represented in the legend??

3 ビュー (過去 30 日間)
I know how to choose either the color or marker individually, but how can I choose both together (i.e. red squares)?
I tried plot(x, y, 'square', 'r')
additionally, how can create a legend to represent both color and shape?

回答 (1 件)

James Metz
James Metz 2021 年 2 月 3 日
編集済み: James Metz 2021 年 2 月 3 日
Hey James, it's future you here. I'm here to tell you that you are a dummy who did not read the MATLAB resource page close enough. If you did you would have realized to pair the marker and color within the same apostrophe like so: plot(x, y, 'sr') a lot sooner.
Best,
Future you ;)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by