Adding variables to legends
5 次查看(过去 30 天)
显示 更早的评论
Hi,
I wish to add a variable to a legend which I have discovered how to do, however I would like to have the initial element within the legend untouched and add the variable to the second parameter within the legend.
This piece of code displays what I want displayed in the legend next to the bottom element. I also want to add the initial set of points above this one.
% Sets up variable to display in the legend
Legr2Lin_R5 = compose('y = bx^m, r^2 = %.3g', r2Pwr_R5);
legend(Legr2Lin_R5,'location','se')
If I use this piece of code I get both elements within the legend, but no variable value for the second element as in the code above.
loglog(x_R4,y_R4,x_R4,Ypwr_R4,'*'),xlabel('x'),ylabel('y')
title('Using y = bx^a')
legend('Data Points','y = bx^a')
The question, how do I have both elements displayed in the legend, but also have the variable value displayed next to the second element within the legend?
I have tried a couple of things, but nothing is coming close to working.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!