フィルターのクリア

How do I give the legends for two different values, those individually are calculated multiple times?

1 回表示 (過去 30 日間)
Avi
Avi 2018 年 5 月 10 日
コメント済み: Avi 2018 年 5 月 10 日
I have percentage value graph of two values dependent on the laser angle. These two values are calculated multiple times. I tried to give the legends by the command legend('per Tape irradiated','per substrate irradiated'), but then both the legends are given with the same color. I want to have the corresponding legends according to the percentage of Tape and Substrate irradiated. Percentage Tape irradiated should be blue and percentage of substrate irradiated should be blue.
  3 件のコメント
dpb
dpb 2018 年 5 月 10 日
Well, I'll guess... :) You're calculating the red set of results first, then the blue and then only pass two label strings to legend; hence you label the first two lines which are both red. You need to save the line handles to at least the first red and first blue calculation and then use those handles to associate the labels to the appropriate handle with the alternate legend syntax
"legend(subset,__ ) only includes items in the legend for the data series listed in subset. Specify subset as a vector of graphics objects. ..."
Avi
Avi 2018 年 5 月 10 日
@dpd you guessed it right. My problem is solved. thanks alot. your solution worked.

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

回答 (1 件)

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018 年 5 月 10 日
if true
legend('Percentage Tape Irradiated', 'Percentage Substrate Irradiated') ;
end

カテゴリ

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