【发布时间】:2019-02-22 21:31:00
【问题描述】:
我无法弄清楚如何在每个构面网格元素周围绘制一个黑色边界框。
import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('tips')
g = sb.FacetGrid(df, col = "time")
g.map(plt.hist, "tip")
plt.show()
给:
我想要这样的东西:
我尝试过使用
sb.reset_orig() #after the seaborn import, to reset to matplotlib original rc
以及轴本身的各种选项:
axes=g.axes.flatten()
for ax in axes:
ax. # I can't figure out the right option.
这可能吗?
【问题讨论】:
-
例如:
for ax in axes: ax.spines['bottom'].set_color('black') ax.spines['top'].set_color('black') ax.spines['right'].set_color('black') ax.spines['left'].set_color('black')仅将 X 轴和 Y 轴设为黑色 - 而不是右侧和顶部。嗯..
标签: pandas matplotlib plot seaborn