码迷,mamicode.com
首页 > 其他好文 > 详细

Hole puncher Show Picture

时间:2015-09-27 21:26:38      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:

import sys
reload(sys)
sys.setdefaultencoding(‘utf8‘)

import matplotlib.pyplot as plt
import string

file = open("GD.txt")

i = 0
x = range(0)
y = range(0)

for line in file:
    x.append(string.atoi(line[0:7], 10))
    y.append(string.atoi(line[8:], 10))

print x[1]
print "111111111111"
#print y



# plt.xlabel("x position")
# plt.ylabel("y position")
# plt.title("E track distribution diagram \n Red point is start and Blue point is end.")  
#plt.plot(x,y)




plt.plot(x, y, ‘k--‘, linewidth=1, linestyle="-.")
for i in range(94):
      plt.plot(x[i], y[i], ‘yo-‘, linewidth=1) 

plt.plot(x[0], y[0], ‘r*‘,  linewidth=10)
plt.plot(x[94], y[94], ‘b*‘,  linewidth=10)

plot(x, y)   # plot x and y using blue circle markers
plt.show() 

  

import string
import matplotlib.pyplot as plt  
import numpy as np

file = open("picture.txt")

i = 0
x = range(0)
y = range(0)

for line in file:
    x.append(string.atoi(line[0:7], 10))
    y.append(string.atoi(line[8:], 10))


years = x
price = y

plt.plot(years, price, ‘b*‘)    #,label=$cos(x^2)$)
plt.plot(years, price, ‘r‘)
plt.xlabel(years(+2000))
plt.ylabel("housing average price(*2000 yuan)")
plt.ylim(0, 15)
plt.title(‘line_regression & gradient decrease‘)
plt.legend()
plt.show()

   Hole puncher

Hole puncher Show Picture

标签:

原文地址:http://www.cnblogs.com/hgonlywj/p/4842714.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!