3D Plot with Four Variables
1 次查看(过去 30 天)
显示 更早的评论
Hello, I have four variables (Demand, NPV_all, STD_all, STD_In) and I would like to plot them in a 3D plot. I have created the plot but for some reason I can not show the legend. Can anyone help please.
if true
Demand = rand(7,3);
NPV_all = rand(7,3);
STD_all = rand(7,3);
STD_In = [0.25 .5 .75] .* ones(7,3);
Demand_V = Demand(:);
NPV_V = NPV_all(:);
STD_V = STD_All(:);
STD_In_V = STD_In(:);
h = scatter3(Demand_V,STD_V,NPV_V,markerSize,STD_In_V,'filled');
title('Economic Impact of Production Profile')
xlabel('Demand [MMSCFD]')
ylabel('STD [$B]')
zlabel('NPV [$B]')
legend('STD = 0.25', 'STD = 0.50','STD = 0.75');
end
0 个评论
采纳的回答
KSSV
2018-9-24
Demand = rand(7,3);
NPV_all = rand(7,3);
STD_all = rand(7,3);
STD_In = [0.25 .5 .75] .* ones(7,3);
Demand_V = Demand(:);
NPV_V = NPV_all(:);
STD_V = STD_all(:);
STD_In_V = STD_In(:);
markerSize = 10 ;
STD = [0.25 0.50 0.75] ;
figure
hold on
for i = 1:length(STD)
idx = abs(STD_In_V-STD(i))<=10^-3 ;
h = scatter3(Demand_V(idx),STD_V(idx),NPV_V(idx),markerSize,STD_In_V(idx),'filled');
end
title('Economic Impact of Production Profile')
xlabel('Demand [MMSCFD]')
ylabel('STD [$B]')
zlabel('NPV [$B]')
legend('STD = 0.25', 'STD = 0.50','STD = 0.75');
更多回答(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!