There is no property or method that can modify these fields. You need to fix the source code. Here is an example:
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d.axis3d import Axis if not hasattr(Axis, "_get_coord_info_old"): def _get_coord_info_new(self, renderer): mins, maxs, centers, deltas, tc, highs = self._get_coord_info_old(renderer) mins += deltas / 4 maxs -= deltas / 4 return mins, maxs, centers, deltas, tc, highs Axis._get_coord_info_old = Axis._get_coord_info Axis._get_coord_info = _get_coord_info_new fig = plt.figure() ax = fig.add_subplot(111, projection='3d') for c, z in zip(['r', 'g', 'b', 'y'], [30, 20, 10, 0]): xs = np.arange(20) ys = np.random.rand(20)
Result:

Edit
To change the color of the grid lines:
for axis in (ax.xaxis, ax.yaxis, ax.zaxis): axis._axinfo['grid']['color'] = 0.7, 1.0, 0.7, 1.0
Edit2
Set X and Y lim:
ax.set_ylim3d(-1, 31) ax.set_xlim3d(-1, 21)
Hyry
source share