Issue 1:
Bug summary

There are several rendering errors when creating a bar3d chart:

for some bars the side walls are missing, e.g. at (1,0), (3,0) or (7,0).

the edge to the x-axis of the top of bar (0,1) is partially visible, although it should be completely covered by bar (0,0).

the label of the y-axis is shifted to the left, the 0 is not at the level of the 0-coordinate.

The list of errors is not complete, I think everyone can recognize the errors when looking closely.

Code for reproduction

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm

# generate data
x = np.array(10*list(range(10)))
y = np.array([])
for i in x[0:10]:
y = np.append(y,np.ones(10)*i)
rng = np.random.default_rng(4)
z = rng.random(len(x))+0.5

# plot
fig = plt.figure()
ax = fig.add_subplot(1,1,1, projection='3d')
ax.set_xlabel('x')
ax.set_ylabel('y')
x_pos = x-1/2
y_pos = y-1/2
z_pos = [0]*len(z)
x_size = np.ones(len(z))
y_size = np.ones(len(z))
z_size = z
colormap = cm.ScalarMappable()
color = colormap.to_rgba(z)
ax.bar3d(x_pos, y_pos, z_pos, x_size, y_size, z_size, color=color, shade=True)
plt.savefig('plt.png', dpi=300)

Actual outcome

Expected outcome

I expect a correct 3D rendering

Additional information

There is a similar bug reported here.

Operating system

Linux Mint

Matplotlib Version

3.7.0

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

3.10.6

Jupyter version

No response

Installation

pip

Issue 2:
Bug report

Bug summary

Z-order of rendered planes in 3d bar chart produced by bar3d is wrong. It is seen even in the example here https://matplotlib.org/gallery/mplot3d/3d_bars.html. One of the bars (at location 2, 4, height 6) is drawn on top of the highest bar, even though it supposed to be behind it.

Code for reproduction

A small modification of the code from example to make it more pronounced.

import numpy as np
import matplotlib.pyplot as plt
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

# setup the figure and axes
fig = plt.figure(figsize=(8, 8))
ax1 = fig.add_subplot(111, projection='3d')

# fake data
_x = np.arange(8)
_y = np.arange(8)
_xx, _yy = np.meshgrid(_x, _y)
x, y = _xx.ravel(), _yy.ravel()

top = x + y
bottom = np.zeros_like(top)
width = depth = 1

ax1.bar3d(x, y, bottom, width, depth, top, shade=True)
ax1.set_title('Shaded')
plt.show()

Actual outcome

Everything to the right from diagonal is rendered incorrectly.

Matplotlib version

Tested on two machines with the same results.

Operating system: mac and windows

Matplotlib version:

matplotlib 2.1.2 py36h6d6146d_0

and

matplotlib 3.0.3 py37_0 conda-forge

Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline

Python version:

3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 13:19:00)

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]

and

3.7.1 | packaged by conda-forge | (default, Mar 13 2019, 13:32:59) [MSC v.1900 64 bit (AMD64)]

Jupyter version (if applicable):

ipython 5.1.0 py36_1

and

ipython 7.3.0 py37h39e3cac_0 conda-forge