Why can't I add title to plot in R2013a?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mohammed
am 12 Okt. 2016
Kommentiert: Mohammed
am 13 Okt. 2016
I haven't used MATLAB in a while but last time I tried, I didn't have any issues with plotting function. Now when I am plotting and adding a title to the legend, apparently as shown below, It won't show up! Any suggestions toward fixing this issue would be greatly appreciated?!
clear, clc, clf, cla reset, format shortg,
g_compress = CompressExtract('CompressExtract.csv',2,1000);
g_table = g_compress(:,[1,12]);
g_Bins = g_table(:,1);
g_RSCP = g_table(:,2);
plot(g_Bins,g_RSCP,'-','Color',[0.5, 0, 0], ...
'LineWidth',1,'LineSmoothing','on')
lgd = legend('Example','Location','S');
title(lgd,'My Legend Title')
axis([0 1000 -100 -40]), grid on

2 Kommentare
Akzeptierte Antwort
Ganesh Hegade
am 13 Okt. 2016
Bearbeitet: Walter Roberson
am 13 Okt. 2016
Hi,
Normally for title
title(str)
title(str,Name,Value)
title(ax,___)
but the value of
lgd = legend('Example','Location','S');
is not a string or axis details.
I think you should just use 'legend(your specifications)' to locate the legend details on the graph and then add the title name.
Thanks.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Find more on Title in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!