一.用默认设置绘制折线图 import matplotlib.pyplot as plt x_values=list(range(11)) #x轴的数字是0到10这11个整数 y_values=[x**2 for x in x_values] #y轴的数字是x轴数字的平方 plt.plot(x_values,y_values,c='green') #用plot函数绘制折线图,线条颜色设置为绿色 plt.title('Squares',fontsize=24) #设置图表标题和标题字号 plt.t
peaks; axis tight %Set the axis limits to equal the range of the data axis square axis 'auto x' %x轴坐标上下限自动调整 axis off %Plot a surface without displaying the axes lines and background. set(gca,'Visible','off'); %消除坐标轴,显示范围的大小没有改变,同上句 %更多特性
一.语法简介 plt.xlabel("销售月份",fontsize=16,color='red',fontweight='bold',loc='center',backgroundcolor='black', labelpad=10,rotation=1,alpha=1) '''fontsize 设置字体大小 默认值为12fontweight 设置字体粗细 color 设置字体颜色loc 设置标题对齐方式 具体值有center left right top bottombackgrou