小编use*_*975的帖子

在matplotlib中制作更长的子图刻度标记?

我试图改变沿python多面板子图的轴的刻度线.我有两个共用一个x轴的面板.我已经使绘图周围的边框更粗,并使沿轴的所有刻度线更粗.我有两个问题:

如何使所有刻度线(两个轴)更长,以便更加明显?

如何在主要刻度线之间添加较小但仍然明显的刻度线?

这是我到目前为止的最低工作示例.

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() …
Run Code Online (Sandbox Code Playgroud)

python matplotlib subplot

19
推荐指数
1
解决办法
1万
查看次数

标签 统计

matplotlib ×1

python ×1

subplot ×1