• R/O
  • SSH

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

File Info

Rev. 52319bf6b3af53fd740ad60d3b5a7d87f63ff81a
Size 770 bytes
Time 2007-07-27 19:48:41
Author iselllo
Log Message

I added the code pylab_tex.py which shows some of the pylab's
capabilities to use Tex in figures.

Content

#!/usr/bin/env python
# implement the example graphs/integral from pyx
from pylab import *
#from matplotlib.patches import *  # Polygon

def func(x):
    return (x-3)*(x-5)*(x-7)+85

ax = subplot(111)

a, b = 2, 9 # integral area
x = arange(0, 10, 0.01)
y = func(x)
plot(x, y, linewidth=1)

# make the shaded region
ix = arange(a, b, 0.01)
iy = func(ix)
verts = [(a,0)] + zip(ix,iy) + [(b,0)]
poly = Polygon(verts, facecolor='0.8', edgecolor='k')
ax.add_patch(poly)

text(0.5 * (a + b), 30,
     r'$\cal{R}\prod_{i=\alpha\cal{B}}^\infty a_i\rm{sin}(2 \pi f x_i)$'\
     , horizontalalignment='center',
     fontsize=20)

axis([0,10, 0, 180])
#figtext(0.9, 0.05, 'x')

xlabel('$\Delta_i$', fontsize=20)
figtext(0.1, 0.90, 'y')

xticks((a,b), ('a','b'))
yticks([])

show()