3D bar plot, does not show solid bars
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Walter Roberson
le 29 Avr 2025
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 commentaires
Walter Roberson
le 30 Avr 2025
https://www.mathworks.com/matlabcentral/answers/2176730-3d-bar-plot-does-not-show-solid-bars#comment_3332736 clearly shows negative "error"
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!