【发布时间】:2017-07-20 09:50:18
【问题描述】:
我编写了以下装饰函数来更改每个绘图任务调用 ggplot 的默认样式:
# Style plots (decorator)
def plot_styling(func):
def wrapper(*args, **kwargs):
style = {'axes.titlesize' : 24,
'axes.labelsize' : 20,
'lines.linewidth' : 3,
'lines.markersize' : 10,
'xtick.labelsize' : 16,
'ytick.labelsize' : 16,
}
with plt.style.context((style)):
ax = func(*args, **kwargs)
return wrapper
现在,我想将默认网格颜色从浅灰色更改为白色,并将网格线更改为灰色。我该怎么办?
【问题讨论】:
标签: python ggplot2 styles decorator