import matplotlib.pyplot as plt slices = [7,2,2,13] activities = ['sleeping','eating','working','playing'] colors = ['c','m','r','g'] plt.pie( slices,...
分类:
其他好文 时间:
2015-11-05 06:05:36
阅读次数:
131
import matplotlib.pyplot as plt days = [1,2,3,4,5] sleeping = [7,8,6,11,7] eating = [3,3,4,2,3] working = [7,8,7,3,2] playing = [7,5,7,8,12] #stack ch...
分类:
其他好文 时间:
2015-11-05 00:44:58
阅读次数:
337
在给画出的直线加上图例和标签可以参照下面的代码import matplotlib.pyplot as pltx1 = [1,2,3]y1 = [5,7,4]x2 = [1,2,3]y2 = [10,14,12]plt.plot(x1,y1,label='line1')plt.plot(x2,y2,l...
分类:
其他好文 时间:
2015-11-04 14:41:48
阅读次数:
181
要使用matplotlib画直线可以使用下面的方法import matplot.pyplot as pltplt.plot([1,2,3],[5,7,4]) #plt.plot([x1,x2,x3],[y1,y2,y3])plt.show()(x1, y1,), (x2,y2) 决定了另外一条直线(...
分类:
其他好文 时间:
2015-11-04 14:37:54
阅读次数:
191
读取部分结果程序# -*- coding: utf-8 -*-import numpy as np import matplotlib.pyplot as pltfrom PIL import Imagedef ImagetoData(num=100): filename = 'face/fa...
分类:
编程语言 时间:
2015-11-01 11:19:24
阅读次数:
521
程序# coding=gbkfrom PIL import Imageimport numpy as np# import scipyimport matplotlib.pyplot as pltdef ImageToMatrix(filename): # 读取图片 im = Image...
分类:
编程语言 时间:
2015-11-01 11:19:16
阅读次数:
254
首先安装matplotlib,使用pip install matplotlib。安装完成后在python的命令行敲入import matplotlib,如果没问题,说明安装成功可以开始画图了。看好了,见证奇迹的时刻from matplotlib import pyplot as pltplt.plo...
分类:
其他好文 时间:
2015-10-20 19:15:50
阅读次数:
247
import sysreload(sys)sys.setdefaultencoding('utf8')import matplotlib.pyplot as pltimport stringfile = open("GD.txt")i = 0x = range(0)y = range(0)for l...
分类:
其他好文 时间:
2015-09-27 21:26:38
阅读次数:
217
import matplotlibmatplotlib.use('Agg')import matplotlib.pyplot as pltfrom Cstring import StringIOy = [3, 10, 7, 5, 3, 4.5, 6, 8.1]N = len(y)x = range(...
分类:
编程语言 时间:
2015-09-12 17:44:02
阅读次数:
778
这是是用julia来实现绘图,julia有三个绘图库:Winston、Gadfly、PyPlot
这里用的是pyplot,其实他是基于matplotlib的
1、首先在juno里安装两个库
juno是julia的集成开放环境(IDE)
没有安装juno的请看这里:
Pkg.add("DataFrames")#表格库,这个好像装juno的时候就装好了
Pkg.add("PyPlot")#绘...
分类:
其他好文 时间:
2015-08-20 13:03:25
阅读次数:
388