3D bar plot, does not show solid bars
4 次查看(过去 30 天)
显示 更早的评论
i am using bar3 to do the 3D bar plots
when I use log scale for the z axis, only the top face of the 3D bar (say cuboid) shows, the rest of the bar is invisible,
figure;
bar3(err_data(:,:,2))
set(gca,'ZScale', 'log');

this does not happen on removing log scale
figure;
bar3(err_data(:,:,2))

0 个评论
回答(2 个)
Walter Roberson
2025-4-29
You have negative z data. When you set(gca,'ZScale', 'log') then any shape that has a vertex with negative Z cannot be rendered. Remeber that the log() of negative data is pi*1i plus log(-1*data) and renderers cannot handle the imaginary component of the resulting vertices.
3 个评论
Walter Roberson
2025-4-30
https://www.mathworks.com/matlabcentral/answers/2176730-3d-bar-plot-does-not-show-solid-bars#comment_3332736 clearly shows negative "error"
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!