Adding legend to plot window before actually plotting
Ältere Kommentare anzeigen
I have written a timer object function which updates a plot every 10ms. The plot window is all set up before the first timerFCN iteration. It basically plots 2 sets of data (one red line and one blue line with respect to time). I need to add a legend to this plot. Is there somehow i create a custom legends (i.e. define my own linestyle and linecolour for the legend). Since it only starts plotting once the first timerFcn runs, if i try to add a legend before this, it comes up with Warning: Plot empty.
I could add the legend in the timerFcn code section, but since its running every 10ms, just running that one extra line will cause my code to run a bit slower, which i cant have.
Thanks
Akzeptierte Antwort
Weitere Antworten (1)
Nitin
am 22 Jan. 2014
0 Stimmen
Did you try to go in Edit-> Figure Properties in the plot window?
Kategorien
Mehr zu Legend finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!