在这里您可以找到我的代码.. 基本上,python 默认情况下会返回一个带有 x-ticks 标签的图,例如 4,6,8...,而我想要的是 4,5,6,7,8..有什么帮助吗?非常感谢!!
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure(1)
host = SubplotHost(fig, 111)
fig.add_subplot(host)
c13=[1.79, 2.15, 3.81, 6.12, 8.28, 7.93, 8.07, 8.88]
c13014=[3.12, 3.28, 4.57, 7.24, 8.37, 9.26, 8.24, 8.25]
C13dflow=[0., 0., 0., 0., 8.06, 8.13]
d20=[5, 7, 8, 9, 10, 11, 12, 13]
d20low=[5, 7, 8, 10, 11, 13]
host.plot(d20, c13, 'ro')
host.plot(d20, c13, 'r-', label='f1=0.01 (0.09 in TDU)')
host.plot(d20, c13014, 'bo')
host.plot(d20, c13014, 'b--', label='f1=0.014 (0.126 in TDU)')
host.plot(d20low, C13dflow, 'go')
host.plot(d20low, C13dflow, 'g-.', label='f1=0.01 (0.01 in TDU)')
host.axis([4., 14., 0., 10.])
legend(loc=2)
plt.ylabel('$^{13}C$ pocket mass [$10^{-5}$ $M_{\odot}$]', fontsize=27)
plt.xlabel('Log(D20) [$cm^{2}$/s]', fontsize=27)
plt.title('Max $^{13}C$ pocket masses using double-f overshooting ', fontsize=27)
size=20
plt.xticks(size=size)
plt.yticks(size=size)
host.toggle_axisline(False)
host.grid(True)