2 new revisions:
Revision: 8df981309215
Branch: default
Author: "Hans Petter Langtangen <
h...@simula.no>"
Date: Tue Feb 10 18:17:47 2015 UTC
Log: updates
https://code.google.com/p/scitools/source/detail?r=8df981309215
Revision: 0dc64355df44
Branch: default
Author: "Hans Petter Langtangen <
h...@simula.no>"
Date: Tue Feb 10 18:19:11 2015 UTC
Log: updates
https://code.google.com/p/scitools/source/detail?r=0dc64355df44
==============================================================================
Revision: 8df981309215
Branch: default
Author: "Hans Petter Langtangen <
h...@simula.no>"
Date: Tue Feb 10 18:17:47 2015 UTC
Log: updates
https://code.google.com/p/scitools/source/detail?r=8df981309215
Modified:
/doc/src/easyviz/easyviz_2D3D.do.txt
/lib/scitools/easyviz/gnuplot_.py
/lib/scitools/numpyutils.py
=======================================
--- /doc/src/easyviz/easyviz_2D3D.do.txt Sat Sep 1 04:05:31 2012 UTC
+++ /doc/src/easyviz/easyviz_2D3D.do.txt Tue Feb 10 18:17:47 2015 UTC
@@ -120,8 +120,8 @@
* `contour3`: Same as `contour`, but the curves are drawn at their
corresponding height levels in 3D space.
- * `meshc`: Works in the same way as `mesh` except that a
- contour plot is drawn in the plane beneath the mesh.
+ * `meshc`: Displays the same plot as `mesh`, but with an additional
+ contour plot drawn in a plane beneath the mesh.
* `surfc`: Same as `meshc` except that a solid surface is
drawn instead of a wireframe mesh.
@@ -177,7 +177,7 @@
FIGURE:[figs/contourf_ex1, width=500] Filled contour plot created by the
contourf command (VTK backend). label{fig:contourf_ex1}
-The contour lines can be "lifted up" in 3D space, as shown in Figure
+The contour lines can be ``lifted up'' in 3D space, as shown in Figure
ref{fig:contour3_ex1}, using the `contour3` command:
!bc pycod
contour3(xv, yv, values, 15)
@@ -554,13 +554,3 @@
Figure ref{fig:streamribbon_ex1} shows the resulting stream ribbons.
FIGURE:[figs/streamribbon_ex1, width=500] Stream ribbons (VTK backend).
label{fig:streamribbon_ex1}
-
-
-
-
-
-
-
-
-
-
=======================================
--- /lib/scitools/easyviz/gnuplot_.py Thu Jan 29 17:39:57 2015 UTC
+++ /lib/scitools/easyviz/gnuplot_.py Tue Feb 10 18:17:47 2015 UTC
@@ -32,7 +32,7 @@
from __future__ import division
from .common import *
-from scitools.numpyutils import ones, ravel, shape, newaxis, rank,
transpose, \
+from scitools.numpyutils import ones, ravel, shape, newaxis, transpose, \
linspace, floor, array
from scitools.globaldata import DEBUG, VERBOSE
from scitools.misc import check_if_module_exists , system
@@ -525,7 +525,7 @@
isinstance(cmap[1], int) and \
isinstance(cmap[2], int):
self._g('set palette rgbformulae %d,%d,%d' % cmap) # model RGB?
- elif isinstance(cmap, collections.Sequence) and rank(cmap) == 2:
+ elif isinstance(cmap, collections.Sequence) and cmap.ndim == 2:
m, n = shape(cmap)
assert n==3, "colormap must be %dx3, not %dx%d." % (m,m,n)
tmpf = tempfile.mktemp(suffix='.map')
@@ -797,7 +797,7 @@
# get line specifiactions:
marker, color, style, width = self._get_linespecs(item)
- if rank(y) == 1:
+ if y.ndim == 1:
y = reshape(y,(len(y),1))
nx, ny = shape(y)
@@ -908,11 +908,11 @@
withstring += 'l palette'
if item.getp('indexing') == 'xy':
- if rank(x) == 2 and rank(y) == 2:
+ if x.ndim == 2 and y.ndim == 2:
x = x[0,:]; y = y[:,0]
z = transpose(z, [1,0])
else:
- if rank(x) == 2 and rank(y) == 2:
+ if x.ndim == 2 and y.ndim == 2:
x = x[:,0]; y = y[0,:]
kwargs = {'title': self._fix_latex(item.getp('legend')),
'with': withstring,
@@ -971,10 +971,10 @@
if item.getp('indexing') == 'xy':
z = transpose(z, [1,0])
- if rank(x) == 2 and rank(y) == 2:
+ if x.ndim == 2 and y.ndim == 2:
x = x[0,:]; y = y[:,0]
else:
- if rank(x) == 2 and rank(y) == 2:
+ if x.ndim == 2 and y.ndim == 2:
x = x[:,0]; y = y[0,:]
kwargs = {'title': self._fix_latex(item.getp('legend')),
'binary': 0,
@@ -1018,7 +1018,7 @@
# draw velocity vectors as arrows with components (u,v) at
# points (x,y):
if shape(x) != shape(u):
- if rank(x) == 2:
+ if x.ndim == 2:
x = x*ones(shape(u))
else:
if item.getp('indexing') == 'xy':
@@ -1026,7 +1026,7 @@
else:
x = x[:,newaxis]*ones(shape(u))
if shape(y) != shape(u):
- if rank(y) == 2:
+ if y.ndim == 2:
y = y*ones(shape(u))
else:
if item.getp('indexing') == 'xy':
@@ -1093,7 +1093,7 @@
v = item.getp('vdata') # volume
sx, sy, sz = item.getp('slices')
- if rank(sz) == 2:
+ if sz.ndim == 2:
# sx, sy, and sz defines a surface
pass
else:
@@ -1112,11 +1112,11 @@
v = item.getp('vdata') # volume
sx, sy, sz = item.getp('slices')
- if rank(sz) == 2:
- # sx, sy, and sz defines a surface
+ if sz.ndim == 2:
+ # sx, sy, and sz define a surface
pass
else:
- # sx, sy, and sz is either numbers or vectors with numbers
+ # sx, sy, and sz are either numbers or vectors with numbers
pass
cvector = item.getp('cvector')
=======================================
--- /lib/scitools/numpyutils.py Tue Jan 27 15:34:28 2015 UTC
+++ /lib/scitools/numpyutils.py Tue Feb 10 18:17:47 2015 UTC
@@ -71,10 +71,27 @@
import collections
from functools import reduce
from Heaviside import *
+import numpy
def meshgrid(x=None, y=None, z=None, sparse=False, indexing='xy',
memoryorder=None):
+ """Now just a call to numpy.meshgrid (for numpy version >= 1.7)."""
+ # In the past, numpy.meshgrid only worked for 2D problems and this
+ # was the generalization that is now incorporated in numpy v1.7.
+ args = []
+ if x is not None:
+ args.append(x)
+ if y is not None:
+ args.append(y)
+ if z is not None:
+ args.append(z)
+ return numpy.meshgrid(*args, indexing=indexing, sparse=sparse)
+
+def meshgrid_scitools(x=None, y=None, z=None, sparse=False, indexing='xy',
+ memoryorder=None):
"""
+ Original scitools.std.meshgrid:
+
Extension of ``numpy.meshgrid`` to 1D, 2D and 3D problems, and also
support of both "matrix" and "grid" numbering.
(See below how it relates to ``meshgrid``, ``ogrid``, and ``mgrid``
==============================================================================
Revision: 0dc64355df44
Branch: default
Author: "Hans Petter Langtangen <
h...@simula.no>"
Date: Tue Feb 10 18:19:11 2015 UTC
Log: updates
https://code.google.com/p/scitools/source/detail?r=0dc64355df44
Modified:
/lib/scitools/easyviz/matplotlib_.py
=======================================
--- /lib/scitools/easyviz/matplotlib_.py Thu Jan 29 07:40:04 2015 UTC
+++ /lib/scitools/easyviz/matplotlib_.py Tue Feb 10 18:19:11 2015 UTC
@@ -593,7 +593,7 @@
if opacity is None:
opacity = 1.0
- if rank(y) == 1:
+ if y.ndim == 1:
y = reshape(y,(len(y),1))
nx, ny = shape(y)
@@ -860,7 +860,7 @@
v = item.getp('vdata') # volume
sx, sy, sz = item.getp('slices')
- if rank(sz) == 2:
+ if sz.ndim == 2:
# sx, sy, and sz defines a surface
pass
else:
@@ -876,7 +876,7 @@
v = item.getp('vdata') # volume
sx, sy, sz = item.getp('slices')
- if rank(sz) == 2:
+ if sz.ndim == 2:
# sx, sy, and sz defines a surface
pass
else: