I have a similar problem as described in How to prevent numbers being changed to exponential form in Python matplotlib figure:
I don't want that (in my special case) weird scientific formatting of the axis. My problem is different as I have this problem at my z
-Axis. For 2-D plots I can use ax.get_yaxis().get_major_formatter().set_useOffset(False)
. And there is no function ax.get_zaxis()
What do I use to format my z
-Axis the same way?
EDIT: Example:
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import sys
import matplotlib
import matplotlib.pyplot as pyplot
def func(xi, ti):
res = 10e3 + np.cos(ti) * np.sin(xi)
return res
if __name__ == '__main__':
timeSpacing = 20
timeStart = 0
timeEnd = 1
time = np.linspace(timeStart, timeEnd, timeSpacing)
widthSpacing = 50
widthStart = 0
widthEnd = 3
width = np.linspace(widthStart, widthEnd, widthSpacing)
resList = []
matplotlib.rcParams['legend.fontsize'] = 10
fig = pyplot.figure()
ax = fig.gca(projection = '3d')
for i, item in enumerate(time):
ti = [item for t in width]
res = func(width, ti)
ax.plot(width, ti, res, 'b')
ax.set_xlabel('x')
ax.set_ylabel('t')
ax.set_zlabel('f(x,t)')
pyplot.show()