When using matplotlib
's scatter
module for plotting scattered data on 3D, the options color
and marker
do not behave as expected, e.g.,
color='r', marker='o'
produce blue dots surrounded by red circles, instead of just filled red circles.
Why this is happening?
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
N = 100
x = 0.9 * np.random.rand(N)
y = 0.9 * np.random.rand(N)
z = 0.9 * np.random.rand(N)
##### Plotting:
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.scatter(x, y, z, color='r', marker='o')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
plt.show()