我正在尝试调整Python多面板子图中坐标轴上的刻度标记。我有两个共享公共x轴的面板。我已经将图的边框加粗,并使所有沿坐标轴的刻度标记变粗。我的问题如下:
1.如何使所有刻度标记(两个轴)更长,以便更容易看到?
2.如何在主要刻度标记之间添加较小但仍可见的刻度标记?
以下是迄今为止所拥有的最小工作示例。
from numpy import *
from scipy import *
from pylab import *
from random import *
import pylab
import matplotlib.pyplot as plt
#make the axis border thick
pylab.rc("axes", linewidth=4.0)
pylab.rc("lines", markeredgewidth=4)
#create a figure with two panels that shares the x-axis
f, (ax1, ax2) = plt.subplots(2, sharex=True, sharey=False)
#example figure1
ax1.plot(range(2),range(2),linewidth=2)
#example figure 2
ax2.plot(range(2),range(2),linewidth=2)
# Fine-tune figure; make subplots close to each other and hide x ticks for
# all but bottom plot.
f.subplots_adjust(hspace=0)
plt.setp([a.get_xticklabels() for a in f.axes[:-1]], visible=False)
show()
axes.tick_params()
可用参数的列表? - Atcoldax.xaxis.set_tick_params(length=0, width=0, which='minor')
。 - PatrickT