I have set
import matplotlib as mpl
AXES_COLOR = \'#333333\'
mpl.rc(\'axes\', edgecolor=AXES_COLOR, labelcolor=AXES_COLOR, grid=True)
mpl.rc(\'xtick\', color
Instead of changing axis3d.py try this: ax.w_xaxis.line.set_color("red")
Turns out it's impossible since these values are hard-coded. This archived email from the matplotlib-users mailing list helped me. Here's the relevant part:
Unfortunately, you have stumbled upon one of the ugliness of the mplot3d implementation. I am hoping to have more control available for the next release. But right now, there is no way to turn off the axes spines (because they aren't implemented as spines). If you really want to dig into the source code, you could change the color argument to the Line2D call in the init3d() method in matplotlib/lib/mpl_toolkits/axis3d.py
Although this answer was addressing another concern, it sent me to the direction of axis3d.py. I found it in /usr/lib/pymodules/python2.7/mpl_toolkits/mplot3d. I made a backup of the original axis3d.py and I moved axis3d.pyc away.
Since the code is pretty short and fairly well written it didn't take long to locate the two lines I had to change.
self.line=... in __init__: just replace color=(0, 0, 0, 1) by color=(1, 0, 0, 1) for a horribly flashy red. Components of the tuple are red, green, blue, alpha, all floats from 0 to 1.draw method. I replaced the color self.gridlines.set_color([(0.9,0.9,0.9,1)] * len(lines)) by something of my choosing.And that's it, it just works. Not the most convenient, but it's not more work than editing a rc configuration file.
I did not recreate a .pyc file. It does not recreate itself because I do not run my python code as root. I don't mind the extra milliseconds that python needs to recompile the .py each time.