[python-arrayfire] 151/250: FEAT: Adding graphics functions from arrayfire 3.2
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:43 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository python-arrayfire.
commit 5e92e721b92ecacc09f841cbcb21e25abadebeb6
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Tue Dec 8 18:38:42 2015 -0500
FEAT: Adding graphics functions from arrayfire 3.2
---
arrayfire/graphics.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/arrayfire/graphics.py b/arrayfire/graphics.py
index 25f6859..4cc5969 100644
--- a/arrayfire/graphics.py
+++ b/arrayfire/graphics.py
@@ -109,6 +109,20 @@ class Window(object):
"""
self._cmap = cmap
+ def set_size(self, w, h):
+ """
+ Set the windo height and width.
+
+ Parameters
+ -----------
+ w : int
+ Width if window.
+
+ h : int
+ Height of window.
+ """
+ safe_call(backend.get().af_set_size(self._wnd, w, h))
+
def image(self, img, title=None):
"""
Display an arrayfire array as an image.
@@ -145,6 +159,46 @@ class Window(object):
_cell = _Cell(self._r, self._c, title, self._cmap)
safe_call(backend.get().af_draw_plot(self._wnd, X.arr, Y.arr, ct.pointer(_cell)))
+ def plot3(self, line, title=None):
+ """
+ Renders the input array as a 3D line plot.
+
+ Paramters
+ ---------
+
+ data: af.Array.
+ A 2 dimensional array containing (X,Y,Z) co-ordinates.
+
+ title: str.
+ Title used for the plot.
+ """
+ _cell = _Cell(self._r, self._c, title, self._cmap)
+ safe_call(backend.get().af_draw_plot3(self._wnd, data.arr, ct.pointer(_cell)))
+
+ def surface(self, z_vals, x_vals, y_vals, title=None):
+ """
+ Renders the input array as a 3D surface plot.
+
+ Paramters
+ ---------
+
+ z_vals: af.Array.
+ A 1 dimensional array containing Z co-ordinates.
+
+ x_vals: af.Array.
+ A 1 dimensional array containing X co-ordinates.
+
+ y_vals: af.Array.
+ A 1 dimensional array containing Y co-ordinates.
+
+ title: str.
+ Title used for the plot.
+ """
+ _cell = _Cell(self._r, self._c, title, self._cmap)
+ safe_call(backend.get().af_draw_surface(self._wnd,
+ z_vals.arr, x_vals.arr, y_vals.arr,
+ ct.pointer(_cell)))
+
def hist(self, X, min_val, max_val, title=None):
"""
Display a histogram Plot.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git
More information about the debian-science-commits
mailing list