I've tried looking around to solve my issue, and some answers state that the zorder
of Matplotlib have bugs and others say that it works for them. Regardless, here's the image and code that have been causing problems:
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_xlim(0, 7)
ax.set_ylim(0, 7)
ax.set_zlim(0, 7)
ax.view_init(elev=20, azim=32)
# u
ax.quiver(0, 0, 0, 1, 1, 0, color='C0', arrow_length_ratio=0.1,
label=r'$\vec{u}$', zorder=10)
# v
ax.quiver(0, 0, 0, 2, 2, 0, color='C1', arrow_length_ratio=0.1,
label=r'$\vec{v}$', zorder=0)
plt.legend()
ax.set_xlabel(r'$x$', fontsize='large')
ax.set_ylabel(r'$y$', fontsize='large')
ax.set_zlabel(r'$z$', fontsize='large')
plt.show()
This code produces the following image:
I want the blue arrow to be on top of the orange one. Specifying the zorder
doesn't seem to work. Would anybody be kind enough to give me some tips and advice?
Thanks.