小编luk*_*_16的帖子

Matplotlib:在图形后面保留网格线,但上面的y和x轴

我很难在我的图形下绘制网格线而不会弄乱主x轴和y轴zorder:

import matplotlib.pyplot as plt
import numpy as np


N = 5
menMeans = (20, 35, 30, 35, 27)
menStd =   (2, 3, 4, 1, 2)

ind = np.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars

fig, ax = plt.subplots()
rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd, alpha=0.9, linewidth = 0,zorder=3)

womenMeans = (25, 32, 34, 20, 25)
womenStd =   (3, 5, 2, 3, 3)
rects2 = ax.bar(ind+width, womenMeans, width, color='y', …
Run Code Online (Sandbox Code Playgroud)

python plot matplotlib

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

标签 统计

matplotlib ×1

plot ×1

python ×1