Commit d0c919270867ef1f9f9320f978777219d5608e22

imshow grid.Plane
show_img.py
(35 / 0)
  
1#!/usr/bin/env python
2#-*- mode: python -*-
3
4from convention import *
5import_convention(globals())
6
7from pylab import *
8from mpmath import *
9
10
11# program start
12data = numpy.zeros((50,50))
13
14for i in range(0,50):
15 for j in range(0,50):
16 coefficient = pi/mpf(12.25)
17 data[i,j] = sin(i*coefficient) * sin(j*coefficient)
18
19
20imshow(data)
21colorbar()
22savefig("show_img.png")
23clf()
24os.system("open show_img.png")
25
26
27# plot grid.Plane
28from fdtd import grid
29plane = grid.Plane(data)
30
31imshow(numpy.array(plane,dtype="float"))
32colorbar()
33savefig("plane.png")
34clf()
35os.system("open plane.png")