Plot with different Line Specs

5 ビュー (過去 30 日間)
Guilherme Gaspar
Guilherme Gaspar 2016 年 9 月 11 日
回答済み: Guilherme Gaspar 2016 年 9 月 11 日
I want to plot three columns of the variable matrixA, with 3 different colors and markers:
'-ok', '-dk', '-+k'
I've tried numerous ways and none of them worked. My plot is this:
vodd = [1:2:5];
semilogy(x,matrixA(:,vodd))
Additionally, I will want to add more matrices, with 3 columns, and specify each collumn with a different color/marker.
semilogy(x,matrixA(:,vodd),x,matrixB(:,vodd),....)
How do I do this?

採用された回答

Guilherme Gaspar
Guilherme Gaspar 2016 年 9 月 11 日
I finally did it:
figure;
namearray={'LineStyle', 'Marker', 'Color'};
valuearray={'-','d','k';... %matrixA
'-','o','k';...%matrixA
'-','+','k';...%matrixA
'-','d','r';...%matrixB
'-','o','r';...%matrixB
'-','+',''};%matrixB
pl=semilogy(x,matrixA(:,vodd),x,matrixB(:,vodd))
set(pl, namearray, valuearray);

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by