# Plot X Y Z data

12 views (last 30 days)
fz on 20 Jan 2023
Answered: Voss on 14 Feb 2023
I need to plot X, Y, Z graph with X being time (or approximate time if easier to plot); Y being total counts and Z being concentration. Data is shown below.

Voss on 14 Feb 2023
ZYX = [ ...
100 454292352 480.9; ...
100 242004000 241.3; ...
100 133391456 122.2; ...
100 66707360 61 ; ...
100 34087840 30.8; ...
10 131312864 483 ; ...
10 66422080 240.6; ...
10 34292800 122.9; ...
10 17087072 60.4; ...
10 9602784 33.7; ...
1 89836064 481.5; ...
1 45083040 241.2; ...
1 22638528 120.9; ...
1 11286688 60.2; ...
1 5770016 30.7; ...
0.1 88813312 483.7; ...
0.1 43648896 240.7; ...
0.1 22367552 124.3; ...
0.1 10805952 60.4; ...
0.1 5409248 31.2; ...
];
As requested:
figure
plot3(ZYX(:,3),ZYX(:,2),ZYX(:,1))
xlabel('Time (sec)')
ylabel('Total Events')
zlabel('Concentration (\mum)')
box on
grid on
Maybe this is better:
figure
hold on
[g,g_id] = findgroups(ZYX(:,1));
data = splitapply(@(x)plot3(x(:,3),x(:,2),x(:,1)),ZYX,g);
legend(compose('%.1f \\mum',g_id),'Location','NorthWest')
% view(3) % uncomment this to see the 3d view
xlabel('Time (sec)')
ylabel('Total Events')
zlabel('Concentration (\mum)')
box on
grid on

### Categories

Find more on Surface and Mesh Plots in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by