want to plot three curves with markers on it, but some markers skipped :like p1,p2,p3. How to make a lended with only three entries(=line+marker on it for each)?

1 回表示 (過去 30 日間)
p1=plot(z1,M1,'- black',z1(1:7:end), M1(1:7:end),'o black');
hold
p2=plot(z2,M2,'- black',z2(1:7:end),M2(1:7:end),'. black');
p3=plot(z3,M3,'- black',z3(1:7:end),M3(1:7:end),'s black');
  1 件のコメント
Endrit Ziba
Endrit Ziba 2017 年 8 月 11 日
found a solution with this:
PLOT1=plot(NaN,NaN,'- o black')
legend([PLOT1],'p1')
for each. happy about more elegant solutions. thank you!

サインインしてコメントする。

採用された回答

alice
alice 2017 年 8 月 11 日
編集済み: alice 2017 年 8 月 11 日
Starting in R2016B, the MarkerIndices line property is doing what you want :
plot(z1,M1,'-s black','MarkerIndices',1:7:length(z3))

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by