【发布时间】:2020-09-08 07:30:48
【问题描述】:
我正在使用 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
【问题讨论】:
-
我不确定你是否需要 $
-
@AnderBiguri 我删除了 $ 并重新运行了代码。不用找了。问题仍然存在。我更新了我的代码,以便清楚地了解它是什么。
标签: matlab for-loop latex legend matlab-figure