How can I name/ categorize columns in my legend?

2 ビュー (過去 30 日間)
Veerle Kohlen
Veerle Kohlen 2021 年 3 月 2 日
回答済み: Keerthana Chiruvolu 2021 年 3 月 10 日
I am plotting temperature against time in two conditions (wind and no wind). In total I have 3 different thermometers, therefore the plot will contain three lines for the no wind condition, and 3 lines for the wind condtion. I want to customize my legend so that it appears like this:
No wind: (line) TCosinuss, (line) Tty, (line)TFastFocus (line)
Wind: (line) TCosinuss, (line) Tty, (line)TFastFocus (line)
This is what I have so far:
hlegend = legend([nw_Cosinuss nw_Tympanic nw_Fastfocus w_Cosinuss w_Tympanic w_Fastfocus], 'T_C_o_s_i_n_u_s_s No Wind', 'T_t_y No Wind', 'T_F_a_s_t_F_o_c_u_s No Wind', 'T_C_o_s_i_n_u_s_s Wind', 'T_t_y Wind', 'T_F_a_s_t_F_o_c_u_s Wind', 'Location', 'SouthOutside', 'Orientation', 'Horizontal', 'FontSize', 15);
hlegend.NumColumns = 3

回答 (1 件)

Keerthana Chiruvolu
Keerthana Chiruvolu 2021 年 3 月 10 日
Hi Veerle,
Please try using the Categorial Arrays as your variables. For more information, see this.

カテゴリ

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