数学建模学习全过程
一. 模块导入:
#在jupyter notebook中
import matplotlib.pyplot as plt
'''
在pycharm中
否则:TypeError: 'figure' is an unknown keyword argument
'''
import matplotlib
matplotlib.use('Qt4Agg')
from matplotlib import pyplot as plt
二. 绘制坐标轴
第一种,原点不居中:
plt.figure(figsize=(3, 2)) #设置坐标轴的大小
plt.title("Score") #设置标题
plt.show() #展示
第二种:原点居中+x轴数值倾斜度设置:
# 去掉边框
ax = plt.gca() # get current axis 获得坐标轴对象
ax.spines['right'].set_color('none') # 将右边 边沿线颜色设置为空 其实就相当于抹掉这条边
ax.