How to format notation to use "... x 10^-5..." instead of "...e..." in this figure
13 次查看(过去 30 天)
显示 更早的评论
采纳的回答
更多回答(1 个)
Dyuman Joshi
2023-5-11
%Random graph
syms x
fplot(jacobiP(1:4,4,4,x))
axis([-1 2 -5 5])
grid on
%Values to be displayed as the legend
arr = rand(4,1)*1e-4
out=floor(log10(arr)); %take abs() of arr in case of negative values
str = compose('%f x 10^{%d}', arr./10.^out, out)
legend(str,'Location','best')
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!