代码搜索结果
找到约 11,834 项符合
Python 的代码
fig27_01.py
# Figure 27.1: fig27_01.py
# A first program in Python
print "Welcome to Python!"
##########################################################################
# (C) Copyright 2001 by Deitel & A
break.py
#!/usr/bin/env python
from pylab import *
gcf().text(0.5, 0.95,
'Distance Histograms by Category is a really long title')
show()
psd_demo.py
#!/usr/bin/env python
# python
from pylab import *
dt = 0.01
t = arange(0,10,dt)
nse = randn(len(t))
r = exp(-t/0.05)
cnse = conv(nse, r)*dt
cnse = cnse[:len(t)]
s = 0.1*sin(2*pi*t) + cnse
subplot
fill_between.py
#!/usr/bin/env python
from pylab import *
x1 = arange(0, 2, 0.01)
y1 = sin(2*pi*x1)
y2 = sin(4*pi*x1) + 2
# reverse x and y2 so the polygon fills in order
x = concatenate( (x1,x1[::-1]) )
y = conca
invert_axes.py
#!/usr/bin/env python
"""
You can use decreasing axes by flipping the normal order of the axis
limits
"""
from pylab import *
t = arange(0.01, 5.0, 0.01)
s = exp(-t)
plot(t, s)
xlim(5,0) # decrea
stem_plot.py
#!/usr/bin/env python
from pylab import *
x = linspace(0.1, 2*pi, 10)
markerline, stemlines, baseline = stem(x, cos(x), '-.')
setp(markerline, 'markerfacecolor', 'b')
setp(baseline, 'color','r', 'lin
scatter_demo.py
#!/usr/bin/env python
from pylab import *
N = 30
x = 0.9*rand(N)
y = 0.9*rand(N)
area = pi*(10 * rand(N))**2 # 0 to 10 point radiuses
scatter(x,y,s=area, marker='^', c='r')
savefig('scatter_demo')
s
vertical_ticklabels.py
#!/usr/bin/env python
from pylab import *
plot([1,2,3,4], [1,4,9,16])
locs, labels = xticks([1,2,3,4], ['Frogs', 'Hogs', 'Bogs', 'Slogs'])
setp(labels, 'rotation', 'vertical')
show()
print_stdout.py
#!/usr/bin/env python
# print png to standard out
# usage: python print_stdout.py > somefile.png
import sys
import matplotlib
matplotlib.use('Agg')
from pylab import *
plot([1,2,3])
savefig(sys.stdo