matplotlib绘图:调整坐标刻度朝内/外

import numpy as np
import matplotlib.pyplot as plt

X = np.linspace(-np.pi, np.pi, 256, endpoint = True)
C, S = np.cos(X), np.sin(X)

plt.rcParams['xtick.direction'] = 'inout'  # in; out; inout
plt.rcParams['ytick.direction'] = 'inout'

plt.plot(X,C)
plt.plot(X,S)

plt.show()

 

你可能感兴趣的:(pythonNote,python小记,python)