Код: Выделить всё
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111)
x = np.linspace(0, 10, 100)
y = np.sin(x)
ax.plot(x, y)
# Move ticks inside
ax.tick_params(axis='x', direction='in')
ax.tick_params(axis='y', direction='in')
Однако в 3D-случайе он не работает аналогичным образом (что неудивительно, если верить веб-сайту matplotlib):
Код: Выделить всё
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
# Sample data
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = np.linspace(0, 10, 100)
y = np.sin(x)
z = np.cos(x)
ax.plot(x, y, z)
# Move ticks inside
ax.tick_params(axis='x', direction='in')
ax.tick_params(axis='y', direction='in')
ax.tick_params(axis='z', direction='in')
plt.show()
Есть ли способ добиться отметок только внутри поля в 3D-случае, чтобы получить 3D-график с внутренними тактами?
Подробнее здесь: https://stackoverflow.com/questions/798 ... matplotlib
Мобильная версия