Wie färbe ich eine bestimmte Gitterlinie / Tickline in einer 3D-Matplotlib-Streudiagramm-Figur ein?
Ich versuche, die Farbe / Dicke einer bestimmten Gitterlinie in einem 3D-Matplotlib-Streudiagramm zu ändern. In diesem Fall soll die -30-Z-Achsen-Gitterlinie schwarz, fett oder verdickt sein, damit sie sich von den anderen Gitterlinien abhebt. Hier ist der Basiscode aus dem mplot3d-Scatterplot-Tutorial:
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
def randrange(n, vmin, vmax):
return (vmax-vmin)*np.random.rand(n) + vmin
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
n = 100
for c, m, zl, zh in [('r', 'o', -50, -25), ('b', '^', -30, -5)]:
xs = randrange(n, 23, 32)
ys = randrange(n, 0, 100)
zs = randrange(n, zl, zh)
scat = ax.scatter(xs, ys, zs, c=c, marker=m)
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()
Ich habe Folgendes versucht:
y_min, y_max = scat.axes.get_ylim()
scat.axes.set_ylim([y_min,y_max])
x_min, x_max = scat.axes.get_xlim()
scat.axes.set_xlim([x_min,x_max])
plt.plot([0.0,0.0], [y_min,y_max], 'k-', lw=2)
plt.plot([x_min,x_max], [0.0225,0.0225], 'k-', lw=2)
un
ax.w_zaxis._axinfo.update({ztick[2] : {'color': (0, 0, 0, 1)}})
ielen Dank im Voraus für die Hilf