代码搜索结果
找到约 10,000 项符合
Python 的代码
image_masked.py
#!/usr/bin/env python
'''imshow with masked array input and out-of-range colors.
'''
from pylab import *
import matplotlib.numerix.ma as ma
import matplotlib.colors as colors
delta = 0.025
x = y =
histogram_demo.py
#!/usr/bin/env python
from pylab import *
mu, sigma = 100, 15
x = mu + sigma*randn(10000)
# the histogram of the data
n, bins, patches = hist(x, 50, normed=1)
setp(patches, 'facecolor', 'g', 'alpha'
matplotlib_icon.py
#!/usr/bin/env python
"""
make the matplotlib svg minimization icon
"""
import matplotlib
matplotlib.use('SVG')
from pylab import *
rc('grid', ls='-', lw=2, color='k')
fig = figure(figsize=(1, 1), dp
axes_demo.py
#!/usr/bin/env python
from pylab import *
# create some data to use for the plot
dt = 0.001
t = arange(0.0, 10.0, dt)
r = exp(-t[:1000]/0.05) # impulse response
x = randn(len(t))
s =
csd_demo.py
#!/usr/bin/env python
"""
Compute the cross spectral density of two signals
"""
from __future__ import division
from pylab import *
dt = 0.01
t = arange(0, 30, dt)
nse1 = randn(len(t))
pie_demo.py
#!/usr/bin/env python
"""
Make a pie chart - see
http://matplotlib.sf.net/matplotlib.pylab.html#-pie for the docstring.
This example shows a basic pie chart with labels in figure 1, and
figure 2 uses
reader4.py
#!/usr/bin/python -u
#
# this tests the basic APIs of the XmlTextReader interface
#
import libxml2
import StringIO
import sys
# Memory debug specific
libxml2.debugMemory(1)
def tst_reader(s):
f
readererr.py
#!/usr/bin/python -u
#
# this tests the basic APIs of the XmlTextReader interface
#
import libxml2
import StringIO
import sys
# Memory debug specific
libxml2.debugMemory(1)
expect="""--> (3) test1:1
fann_trainer.py
#!/usr/bin/python
import os
import sys
from pyfann import libfann
import signal, random
from optparse import OptionParser
random.seed()
class Trainer:
def __init__(self, network_save_fil
func_param.py
#!/usr/bin/env python
# Filename: func_param.py
def printMax(a,b):
if a>b:
print a,'is maximum'
else:
print b,'is maximum'
printMax(3,4) # directly give literal values
x=5
y=7