how can I create a 3D mesh with distributions
5 次查看(过去 30 天)
显示 更早的评论
Hello everyone and thanks for your time. I have 7 individual distributions in 2D, each accounting for different angles. I basically want to create a mesh so that each distribution is plotted at a different value in the z-axis, or the axis coming out of the screen, where all the distributions are interconected. For instance, each distribution correspond to that at Angles = [0,15,30,45,60,75,90] and I would want to plot each of them at such positions in the z-axis. Here is my code, again thanks for the help.
% Plotting code for IIEE stochastic model
% Import the files to be plotted as:
data1 = readmatrix("C:\Users\Jorge\Desktop\Uni\Research\JANUS\IIEE\Results\argon_steel_4keV.txt"); % Reads .txt from specified directory
data2 = readmatrix("C:\Users\Jorge\Desktop\Uni\Research\JANUS\IIEE\Results\argon_steel_4keV_15deg.txt");
data3 = readmatrix("C:\Users\Jorge\Desktop\Uni\Research\JANUS\IIEE\Results\argon_steel_4keV_30deg.txt");
data4 = readmatrix("C:\Users\Jorge\Desktop\Uni\Research\JANUS\IIEE\Results\argon_steel_4keV_45deg.txt");
data5 = readmatrix("C:\Users\Jorge\Desktop\Uni\Research\JANUS\IIEE\Results\argon_steel_4keV_60deg.txt");
data6 = readmatrix("C:\Users\Jorge\Desktop\Uni\Research\JANUS\IIEE\Results\argon_steel_4keV_75deg.txt");
data7 = readmatrix("C:\Users\Jorge\Desktop\Uni\Research\JANUS\IIEE\Results\argon_steel_4keV_90deg.txt");
Energy_0deg = data1(:,2);
Energy_15deg = data2(:,2);
Energy_30deg = data3(:,2);
Energy_45deg = data4(:,2);
Energy_60deg = data5(:,2);
Energy_75deg = data6(:,2);
Energy_90deg = data7(:,2);
% Compute the kernel density estimation for electron energy and depth distribution
% from main ion and recoils
[f1,x1] = ksdensity(Energy_0deg);
[f2,x2] = ksdensity(Energy_15deg);
[f3,x3] = ksdensity(Energy_30deg);
[f4,x4] = ksdensity(Energy_45deg);
[f5,x5] = ksdensity(Energy_60deg);
[f6,x6] = ksdensity(Energy_75deg);
[f7,x7] = ksdensity(Energy_90deg);
Angles = [0,15,30,45,60,75,90];
0 个评论
回答(1 个)
Walter Roberson
2023-5-17
plot3(x1, f1, Angles(1)*ones(size(x1)));
hold on
plot3(x2, f2, Angles(2)*ones(size(x2)));
plot3(x3, f3, Angles(3)*ones(size(x3)));
and so on.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!