具有小数的循环图例的图

问题描述 投票:-1回答:1

我正在使用MATLAB R2018b。我有一个for循环图。我在legend中苦苦挣扎。

我的代码和当前输出:

% Plot 
ColorVec = hsv(length(Phi));
markers = {'+','o','*','.','x','s','d','^','v','>','<','p','h'};
figure;
set(gca,'fontsize',24,'fontname','Times New Roman');
hold on;
for k = 1:length(Nse)
    for i=1:length(Iph)
             plot(V11(:),P(:),'-','color',ColorVec(i,:),'Linewidth',2.0);
    end
end
%%% Following for legend
Legend = cell(length(Phi),1);
 for iter=1:length(Phi)
   Legend{iter}=strcat(num2str(Phi(iter)),'\frac{W}{m^2},',num2str(round(Tc(iter))),' °C ');
 end
hl = legend(Legend);
set(hl ,'Interpreter','latex')
hold off

image

matlab for-loop latex legend matlab-figure
1个回答
2
投票

°无法由Latex识别,并且该分数应包含在$_____$内。您应该使用$^\circ$和Latex Interpreter获取°

© www.soinside.com 2019 - 2024. All rights reserved.