%pylab inline
import numpy as np
import ndap
reload(ndap)
subject = np.ones((5,5,5))
plotter = ndap.NDArrayPlotter(subject)
(fig, ax) = plotter.render()
Populating the interactive namespace from numpy and matplotlib
(fig, ax) = plotter.render(azim=-45,elev=25)
plotter.set_color("#FF0000")
plotter.set_alpha(1.0)
(fig, ax) = plotter.render(azim=-45,elev=25)
plotter.set_scale((0.01, 0.8, 0.8))
plotter.set_spacing(("l", 0.1, 1, 1)) # even = apply to all or apply as a function of l/m/n
colors = plotter.set_color("#00FF00")
colors[:,:,0] = "#FF0000"
colors[:,:,-1] = "#FF0000"
colors[0,:,:] = "#FF0000"
colors[-1,:,:] = "#FF0000"
colors[:,0,:] = "#FF0000"
colors[:,-1,:] = "#FF0000"
(fig_coord, ax_coors) = plotter.render()
subject = np.ones((1,5,5))
plotter = ndap.NDArrayPlotter(subject)
colors = plotter.set_color("#00FF00")
i = 1
colors[0,i,i] = "#0000FF"
colors[0,i,i+1] = "#FF0000"
colors[0,i,i-1] = "#FF0000"
colors[0,i+1,i] = "#FF0000"
colors[0,i-1,i] = "#FF0000"
(fig, ax) = plotter.render()
subject = np.arange(0,9).reshape((1,3,3))
plotter = ndap.NDArrayPlotter(subject, alpha=0.2, spacing=("even", 0.1,0.1,0.1))
colors = plotter.set_color("#FFFF00")
colors[:,1,:] = "#FF0000"
colors[:,0,:] = "#00FF00"
colors[:,2,:] = "#0000FF"
reload(ndap)
(fig_coord, ax_coors) = plotter.render(text=ndap.text_coords)
(fig_values, ax_value) = plotter.render(text=ndap.text_values)
def text_userdef(array, l, m, n):
return "[%d,%d,%d] = %s" % (l, m, n, array[l,m,n])
plotter.set_scale((1.3,1.3,1.3))
(fig_values, ax_value) = plotter.render(text=text_userdef, azim=-10)