Turning plot browser legend back on

I'm currently looking at some plot code where one of the plot has set('IconDisplayStyle', off) so that that plot's information woudn't show up on plot browser.
Currently it looks like this below on plot browser
May 1 Plot a2
May 2 Plot b2
May 3 Plot c3
I don't know too much about the code as was written by someone else. But it looks like this was done to make the date annotation correspond to correctly as without set('IconDisplayStyle', off) it skips the end plots with it's dates. Turn off legend entires? - (mathworks.com)
May 1 Plot a1
May 2 Plot a2
May 3 Plot b1
Plot b2
Plot c1
Plot c2
I would like it to display as
May 1 Plot a1
Plot a2
May 2 Plot b1
Plot b2
May 3 Plot c1
Plot c2
Or as
May 1 Plot a1
May 1 Plot a2
May 2 Plot b1
May 2 Plot b2
May 3 Plot c1
May 3 Plot c2
I wanted to get some ideas on how to do this.

4 件のコメント

Geoff Hayes
Geoff Hayes 2022 年 5 月 13 日
@Emily - can you attach a snapshot of what the figure looks like now? Could you also include the code on how the legend is shown?
Emily
Emily 2022 年 5 月 26 日
Sorry for the late reply.
This is a simplified version of what the plot browser view looks like when icondisplay style is off.
I wasn't able to recreate the legends from this plot but hopefully it gives a clue on what it looks like.
I'm trying to get the dates to show up twice like below.
The code to the legend looks as below
legend(datestr(stored_time, 'mmm dd yyyy'),'location','northeast');
Emily
Emily 2022 年 5 月 26 日
Currently I was able to partially solve this by having the legend input rewrite itself via
stored_time=[time(1), time(1), time(2), time(2)]
But is there a way to do this via loop?
Geoff Hayes
Geoff Hayes 2022 年 5 月 27 日
@Emily - can you show the code that was written that adds the legend to the plot? Or create a small working example that demonstrates the incorrect behaviour?

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Distribution Plots についてさらに検索

質問済み:

2022 年 5 月 13 日

コメント済み:

2022 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by