python 画图去掉边框,设置百分比坐标轴,更改title位置

去掉边框

ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)


设置百分比坐标轴

def to_percent(temp, position):
    return '%1.0f'%(100*temp) + '%'

 

plt.gca().yaxis.set_major_formatter(FuncFormatter(to_percent))


更改title位置

plt.title("冰箱订单价格的累计分布图", x=0.21,)

 

python 画图去掉边框,设置百分比坐标轴,更改title位置_第1张图片

你可能感兴趣的:(python)