フィルターのクリア

Combining plots

1 回表示 (過去 30 日間)
Volkan Kandemir
Volkan Kandemir 2012 年 4 月 4 日
Hi everyone.
I want to combine discontinious line as follows.
h1=plot([0 1],[0 1],'DisplayName','data1')
hold on
h2=plot([5 4],[6 7],'DisplayName','data1')
There will be two lines, one is from (0,0) to (1,1) and other one is from (5,6) to (4,7). Both lines are named as 'data1' but still they are independed of each other. On the Legent there are 2 series named as 'data1'.How to combine these two lines such that there will be only one series named as 'data1'.

採用された回答

Honglei Chen
Honglei Chen 2012 年 4 月 4 日
You can try the following trick and see if it addresses your need.
plot([0 1 nan 5 4],[0 1 nan 6 7],'DisplayName','data1')
legend('data1')
  1 件のコメント
Volkan Kandemir
Volkan Kandemir 2012 年 4 月 4 日
Thanks a lot it will be very helpfull

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by