PythonMatplotlibBoxplot箱线图颜色设置
(2018-07-19 02:26:50)
标签:
pythonboxplotmatplotlib颜色 |
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
data=[2.5,1.13,1.10,0.93,1.34,0.98,0.99,0.82,0.88,1.04,0.89,1.00,0.99,1.09,1.19,0.98,1.15,0.76,0.91,1.03,1.11,1.03,0.72,1.18,1.02,0.97,1.07,0.90,0.88,1.00]
fig = plt.figure(figsize=(12,5))
plt.boxplot(data,notch=False,medianprops={'color':'red'},boxprops=dict(color="blue"),
whiskerprops = {'color': "black"},capprops = {'color':
"cyan"},flierprops={'color':'purple','markeredgecolor':"purple"})
fig.savefig("out.png",format='png',dpi=300)