same display name in two different plot

3 ビュー (過去 30 日間)
PA
PA 2023 年 5 月 6 日
編集済み: Luca Ferro 2023 年 5 月 8 日
How can i use the same display name in two different plot ? and have one display name on the legend.
  3 件のコメント
PA
PA 2023 年 5 月 8 日
Yes the 'Plot title
Dyuman Joshi
Dyuman Joshi 2023 年 5 月 8 日
It's still unclear what you want to do, what is the expected result? Give an example.
Meanwhile look into - figure, title and legend

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

回答 (1 件)

Luca Ferro
Luca Ferro 2023 年 5 月 8 日
移動済み: Image Analyst 2023 年 5 月 8 日
plot(ax, [X1 X2],[Y1 Y2], 'LineWidth',t,'Color',b, 'Displayname', 'Line');
hold on
%... rest of the code
plot(ax, [X1_2 X2_2 ],[Y1_2 Y2_2], 'LineWidth',t_2,'Color','g', 'Displayname', 'Line);
hold off
  2 件のコメント
PA
PA 2023 年 5 月 8 日
Thanks for your solution, but i get a new figure window open and its still the same
Luca Ferro
Luca Ferro 2023 年 5 月 8 日
編集済み: Luca Ferro 2023 年 5 月 8 日
after the two plot(...) use this:
legend('signalName','signalName')
i think this is the closest we can be. Having two lines of different color with only one entry in the legend that describes them both is not supported(as far as i know) and also is not how a legend should work .
If you really want only one entry for both make them of the same color and use again the legend command with only one entry.

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

カテゴリ

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