Hao Wen wrote: > Hi there: > > I tried to plot large numbers and scientific notation has to be used. > But instead of "\times" symbol, it used "e", which cannot be accepted as > publishable. Anyone know how to deal with that?
Add a kwarg to your formatter initialization. See below. Eric > > My original code is: > #################################################### > import matplotlib.pyplot as plt > import numpy as np > from matplotlib.ticker import ScalarFormatter > > # data generation > x = np.arange(1,1e3,20) > y = x**2 > > formatter = ScalarFormatter() formatter = ScalarFormatter(useMathText=True) > formatter.set_scientific(True) > formatter.set_powerlimits((-3,3)) > > fig = plt.figure() > ax = fig.add_subplot(111) > ax.xaxis.set_major_formatter(formatter) > ax.yaxis.set_major_formatter(formatter) > ax.plot(x,y) > > plt.show() > > #################################################### ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users