[英]Setting temporary defaults for plots in matplotlib
If I'm making a series of plots such as: 如果我要进行一系列绘图,例如:
fig,axes = plt.subplots(1,3,figsize=(20,5))
#First Batch of plots
axes[0].hist(...)
axes[1].hist(...)
axes[2].hist(...)
#Second Batch of plots
axes[0].hist(...)
axes[1].hist(...)
axes[2].hist(...)
#Third Batch of plots
axes[0].hist(...)
axes[1].hist(...)
axes[2].hist(...)
plt.show()
and I want all the plots in a single batch to have the same style (eg the same label, the same color,...) I can manually go and add these to the .hist
command, but is there a way to set a 'temporary default' that will make the style of each batch of plots the same? 我希望同一批中的所有图都具有相同的样式(例如,相同的标签,相同的颜色,...),我可以手动将其添加到
.hist
命令中,但是有一种方法可以设置“临时默认”将使每批地块的样式相同吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.