arrayfire.graphics module¶
Graphics functions (plot, image, etc).
- class arrayfire.graphics.Window(width=1280, height=720, title='ArrayFire')[source]¶
Bases:
object
Class to create the Window object.
- Parameters:
- width: optional: int. default: 1280.
Specifies the width of the window in pixels.
- height: optional: int. default: 720.
Specifies the height of the window in pixels.
- title: optional: str. default: “ArrayFire”.
Specifies the title used for the window.
Methods
close
()Close the window.
grid
(rows, cols)Create a grid for sub plotting within the window.
hist
(X, min_val, max_val[, title])Display a histogram Plot.
image
(img[, title])Display an arrayfire array as an image.
plot
(X, Y[, title])Display a 2D Plot.
plot3
(line[, title])Renders the input array as a 3D line plot.
scatter
(X, Y[, marker, title])Renders input arrays as 2D scatter plot.
scatter3
(P[, marker, title])Renders the input array as a 3D Scatter plot.
set_colormap
(cmap)Set the colormap for the window.
set_pos
(x, y)Set the position of window on the screen.
set_size
(w, h)Set the windo height and width.
set_title
(title)Set the title of the window
A flag that shows or hides the window as requested.
show
()Force the window to display the contents.
surface
(x_vals, y_vals, z_vals[, title])Renders the input array as a 3D surface plot.
- grid(rows, cols)[source]¶
Create a grid for sub plotting within the window.
- Parameters:
- rows: int.
Number of rows in the grid.
- cols: int.
Number of columns in the grid.
- set_colormap(cmap)[source]¶
Set the colormap for the window.
- Parameters:
- cmapaf.COLORMAP.
Set the colormap for the window.
- set_pos(x, y)[source]¶
Set the position of window on the screen.
- Parameters:
- xint.
Pixel offset from left.
- yint.
Pixel offset from top
- set_size(w, h)[source]¶
Set the windo height and width.
- Parameters:
- wint
Width if window.
- hint
Height of window.
- set_title(title)[source]¶
Set the title of the window
- Parameters:
- titlestr.
Title used for the current window.
- set_visibility()[source]¶
A flag that shows or hides the window as requested.
- Parameters:
- is_visible: Flag specifying the visibility of the flag.