标签:fonts col top code from for pos spine dict
import numpy from matplotlib import pyplot x=numpy.linspace(-3,3,50) y=2*x+1 pyplot.figure(num=1,figsize=(5,5)) pyplot.plot(x,y,linewidth=10) ax=pyplot.gca() ax.spines[‘right‘].set_color(‘none‘) ax.spines[‘top‘].set_color(‘none‘) ax.xaxis.set_ticks_position(‘bottom‘) ax.spines[‘bottom‘].set_position((‘data‘,0)) ax.yaxis.set_ticks_position(‘left‘) ax.spines[‘left‘].set_position((‘data‘,0)) for label in ax.get_xticklabels()+ax.get_yticklabels(): label.set_fontsize(12) label.set_bbox(dict(facecolor=‘green‘,edgecolor=‘None‘,alpha=2)) pyplot.show()
标签:fonts col top code from for pos spine dict
原文地址:https://www.cnblogs.com/luckiness/p/13162133.html