MATLAB图例legend中输入latex公式

版权声明:转载请注明出处。 https://blog.csdn.net/sinich__eveen/article/details/87731054
X=1:1:10;
Y1=X.^2;
Y2=X.^3;
plot(X,Y1,'b-s',X,Y2,'r-o');
handle=legend('$y=x^2$','$y=x^3$');    %输入“latex代码格式”的图例字符串,并获取该图例的句柄
set(handle, 'interpreter','latex');    %把图例中字符串的解析器设置为“latex”解析器,默认是“tex”解析器

更多更详细参看:MATLAB常用命令高级操作总结

猜你喜欢

转载自blog.csdn.net/sinich__eveen/article/details/87731054
今日推荐