2017-11-02 1 views
0

3D 그리드 눈금 선의 색상을 변경하는 방법을 찾고 있었고 깨끗하고 쉬운 방법을 찾을 수 없었습니다. 내가 찾은 유일한 대답은 here이며 조금 복잡해졌습니다. 쉽게 mpl_toolkits.mplot3dMatplotlib color 3D 눈금 선

간단한 예제를 사용하기 matplotlib에서 3D 플롯의 눈금 선을 색칠하는 방법은 단일 라인에 색깔을 입 힙니다 때문에 here

import matplotlib as mpl 
from mpl_toolkits.mplot3d import Axes3D 
import numpy as np 
import matplotlib.pyplot as plt 

mpl.rcParams['legend.fontsize'] = 10 

fig = plt.figure() 
ax = fig.gca(projection='3d') 
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100) 
z = np.linspace(-2, 2, 100) 
r = z**2 + 1 
x = r * np.sin(theta) 
y = r * np.cos(theta) 
ax.plot(x, y, z, label='parametric curve') 
ax.legend() 

plt.show() 

답변

1

question you found에서 코드가 너무 복잡 발견이 있다면 궁금 해서요 격자.

목적은 simulatneously 모든 눈금 선 색상 화하는 경우, 당신은 사용할 수 있습니다

plt.rcParams['grid.color'] = "deeppink" 

enter image description here