python 折线图绘制

利用plt中plot绘制折线图的代码

import pandas as pd
import os
os.chdir("C:\\Users\Administrator.LAPTOP-1HM8PV0L\Desktop\论文\论文数据\描述性统计分析")
table=pd.read_table("全国层面泰尔指数、indl1、indl2.csv",sep=',',engine="python",header='infer')

x=table.iloc[:,0]
y1=table.iloc[:,1]
y2=table.iloc[:,2]
y3=table.iloc[:,3]


import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

plt.figure(figsize=(12,4))
plt.rcParams['font.sans-serif']=['simHei']
plt.rcParams['axes.unicode_minus']=False
"""
c  青红(cyan)	  r  红色(red)	m  品红(magente)	g  绿色(green) 
y  黄色(yellow)	k  黑色(black)	w  白色(white)	b 蓝色(blue)
ms:控制线条的宽度
linewidth:控制线条的宽度
color:颜色
marker:端点模式,. * 'o'等形式
"""

ax1=plt.subplot(1,3,1)
ax1.plot(x, y1,marker='.',color='b',ms=10,linewidth=2)
ax1.set_title("全国泰尔指数趋势图")
ax1.set(xlabel="年份",xticks=range(2001,2017,3))

ax2=plt.subplot(1,3,2)
ax2.plot(x, y2,marker='.',color='r',ms=10,linewidth=2)
ax2.set_title("全国产业结构层次系数趋势图")
ax2.set(xlabel="年份",xticks=range(2001,2017,3))

ax3=plt.subplot(1,3,3)
ax3.plot(x, y3,marker='.',color='m',ms=10,linewidth=2)
ax3.set_title("全国产业结构质量系数趋势图")
ax3.set(xlabel="年份",xticks=range(2001,2017,3))
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值