Hi Xin,
In newer versions of MATLAB, you can achieve a similar effect to pcolor3 using the slice function along with FaceAlpha property to tune the transparency across the slices.
Please refer to the following example code demonstrating the above discussed steps:
% Sample volumetric data
[X, Y, Z] = meshgrid(linspace(-2, 2, 50), linspace(-2, 2, 50), linspace(-2, 2, 50));
V = X .* exp(-X.^2 - Y.^2 - Z.^2);
% Create slices
slices = linspace(-2, 2, 5);
h = slice(X, Y, Z, V, slices, [], slices);
% Set properties for transparency
alphaValue = 0.1; % Set a numeric value between 0 (fully transparent) and 1 (fully opaque)
for k = 1:length(h)
set(h(k), 'FaceAlpha', alphaValue, 'EdgeColor', 'none');
end
Kindly refer to the following MathWorks documentation to know more about the slice function mentioned above:
Kindly refer to the following MathWorks documentation to know more about the FaceAlpha property mentioned above: https://.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.surface-properties.html?searchHighlight=edge%20color&s_tid=srchtitle_support_results_1_edge%20color#:~:text=FaceAlpha%20%E2%80%94%20Face%20transparency
I hope the information provided above is helpful.