classes beginline exec_menu menu_action scale color fastflush menu_tool show color_all flush nearest size color_list hinton observe unmap colormap label printfile variable erase line push_selected view erase_all mark save_name view_countClass for making a Shape window useful for coloring a shape according to a variable value and creating time and space graphs of a variable. The default variable is v. The first arg may be a SectionList.
PlotShape
.scale(low, high)
sets blue and red values for the color scale and default axes for
time and space plots
?2 view
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
shapeplot.fastflush()
PlotShape
.variable("rangevar")
Range variable (v, m_hh, etc.) to be used for time, space, and
shape plots.
?2 save_name
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
PlotShape
section shape.color(i)
.color_list
PlotShape
.color_all(i)
PlotShape
.color_list(SectionList, i)
PlotShape
s.colormap(size, [global = 0])
s.colormap(index, red, green, blue)
With a single argument, destroys the old and creates a new colormap for shape plots with space for size colors. All colors are initialized to gray.
The four argument syntax, specifies the color of the index element of the colormap. the red, green, and blue must be integers within the range 0-255 and specify the intensity of these colors.
If an existing colormap is displayed in the view, it will be redrawn with the proper colors when scale is called.
PlotShape
s.hinton(&varname, x, y, size)
If there are many of these elements then fastflush can speed plotting by up to a factor of 4 if not too many elements change color between fastflush calls.
create soma access soma objref sl sl = new SectionList() objref s s = new PlotShape(sl) s.colormap(3) s.colormap(0, 255, 0, 0) s.colormap(1, 255, 255, 0) s.colormap(2, 200, 200, 200) s.scale(0, 2) objref vec nx = 30 ny = 30 vec = new Vector(nx*ny) vec.fill(0) for i=0,nx-1 for j=0,ny-1 { s.hinton(&vec.x[i*ny + j], i/nx, j/ny, 1/nx) } s.size(-.5, 1, 0, 1) s.exec_menu("Shape Plot") objref r r = new Random() r.poisson(.01) doNotify() proc p() {local i for i=1,1000 { vec.setrand(r) s.fastflush() // faster by up to a factor of 4 // s.flush() doNotify() } } {startsw() p() print stopsw() }