~ubuntu-branches/ubuntu/utopic/deap/utopic-proposed

« back to all changes in this revision

Viewing changes to doc/code/benchmarks/himmelblau.py

  • Committer: Package Import Robot
  • Author(s): Daniel Stender, Miriam Ruiz, Daniel Stender, Jakub Wilk
  • Date: 2014-07-06 00:03:41 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140706000341-s7gij1ki3d8xz6t9
Tags: 1.0.1-1
[ Miriam Ruiz ]
* New Upstream Release. Closes: #675200
* Upgraded Standards-Version from 3.9.2 to 3.9.5
* Switched to dh_python2
* Upgraded debian/compat to 9
* Added build-arch and build-indep targets to debian/rules
* Using awk to remove connection from the documentation to google analytics
* Using jquery.js and underscore.js from libjs-jquery and libjs-underscore
* Added patches/doc.patch

[ Daniel Stender ]
* deb/control:
  + Added myself to Uploaders.
  + Added version to b-p on python-all.
  + Updated Homepage.
  + Wrapped and sorted.
* deb/copyright:
  + Changed copyright file towards DEP-5.
  + Updated Source URI (project source moved to Github).
  + Added email addresses for copyright holders.
  + Dropped license for eap/toolbox.py (not included anymore).
  + Extended copyrights to 2014.
  + Added myself to copyrights for deb/*.
  + Specified license location.
* Added watch file [initial version by Jackson Doak].

[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from mpl_toolkits.mplot3d import Axes3D
 
2
from matplotlib import cm
 
3
from matplotlib.colors import LogNorm
 
4
import matplotlib.pyplot as plt
 
5
 
 
6
try:
 
7
    import numpy as np
 
8
except:
 
9
    exit()
 
10
 
 
11
from deap import benchmarks
 
12
 
 
13
def untuple(sol):
 
14
    return benchmarks.himmelblau(sol)[0]
 
15
 
 
16
fig = plt.figure()
 
17
ax = Axes3D(fig, azim = -29, elev = 49)
 
18
X = np.arange(-6, 6, 0.1)
 
19
Y = np.arange(-6, 6, 0.1)
 
20
X, Y = np.meshgrid(X, Y)
 
21
Z = np.array(map(untuple, zip(X,Y)))
 
22
 
 
23
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, norm=LogNorm(), cmap=cm.jet, linewidth=0.2)
 
24
 
 
25
plt.xlabel("x")
 
26
plt.ylabel("y")
 
27
 
 
28
plt.show()
 
 
b'\\ No newline at end of file'