--- /home/sjplimp/oldpizza/src/raster.py 2005-09-07 10:13:09.000000000 -0600 +++ /home/sjplimp/pizza/src/raster.py 2005-09-14 09:56:58.000000000 -0600 @@ -22,6 +22,8 @@ r.trans(x,y) translate by x,y in view window (def = 0,0) r.zoom(0.5) scale image by factor (def = 1) r.box(0/1/2) 0/1/2 = none/variable/fixed box +r.box(0/1/2,"green") set box color +r.box(0/1/2,"red",4) set box edge thickness r.file = "image" file prefix for created images (def = "image") r.show(N) show image of snapshot at timestep N @@ -69,19 +71,20 @@ by default, 100 types are assigned if an atom/bond/tri has type > # defined properties, it becomes type = 1 -from vizinfo import colors add new color nickname -colors["nickname"] = [R,G,B] RGB values from 0.0 to 1.0 +from vizinfo import colors access color list +print colors list defined color names and RGB values +colors["nickname"] = [R,G,B] set new RGB values from 0 to 255 - pre-defined colors are red, green, blue, purple, cyan, yellow, black, white + 140 pre-defined colors: red, green, blue, purple, yellow, black, white, etc """ # History # 8/05, Steve Plimpton (SNL): original version +# 9/05, Steve Plimpton (SNL): adjusted box and label attributes # ToDo list # when do aselect with select str while looping N times on same timestep # would not let you grow # of atoms selected -# need to allow color and radius for box lines # Variables # ztheta = vertical angle from z-azis to view from @@ -91,11 +94,13 @@ # distance = characteristic size of simulation scene (largest dim) # file = filename prefix to use for images produced # boxflag = 0/1/2 for drawing simulation box: none/variable/fixed -# eye = eye position in Raster3D header file (set to 50.0) -# bg = color of background +# bxcol = color of box +# bxthick = thickness of box +# bgcol = color of background # amap = settings for atom types # tmap = settings for triangle types # bmap = settings for bond types +# eye = eye position in Raster3D header file (set to 50.0) # Imports and external programs @@ -126,6 +131,8 @@ self.file = "image" self.boxflag = 0 + self.bxcol = [1,1,0] + self.bxthick = 0.3 self.bgcol = [0,0,0] self.labels = [] self.panflag = 0 @@ -141,9 +148,10 @@ # -------------------------------------------------------------------- - def bg(self,bcolor): + def bg(self,color): from vizinfo import colors - self.bgcol = colors[bcolor] + self.bgcol = [colors[color][0]/255.0,colors[color][1]/255.0, + colors[color][2]/255.0] # -------------------------------------------------------------------- @@ -176,14 +184,22 @@ # -------------------------------------------------------------------- - def box(self,n): - self.boxflag = n + def box(self,*args): + self.boxflag = args[0] + if len(args) > 1: + from vizinfo import colors + self.bxcol = [colors[args[1]][0]/255.0,colors[args[1]][1]/255.0, + colors[args[1]][2]/255.0] + if len(args) > 2: self.bxthick = args[2] # -------------------------------------------------------------------- - + # scale down point-size by 3x + def label(self,x,y,font,point,color,text): from vizinfo import colors - list = [x,y,fontlist[font],point,"Left",colors[color],text] + scaledcolor = [colors[color][0]/255.0,colors[color][1]/255.0, + colors[color][2]/255.0] + list = [x,y,fontlist[font],point/3.0,"Left",scaledcolor,text] self.labels.append(list) # -------------------------------------------------------------------- @@ -355,7 +371,7 @@ self.ztrans,1.6*self.distance/self.scale) print >>f,header, - if self.boxflag: box_write(f,box) + if self.boxflag: box_write(f,box,self.bxcol,self.bxthick) ncolor = self.vizinfo.nacolor for atom in atoms: @@ -460,36 +476,39 @@ # -------------------------------------------------------------------- # draw a 12-edge box around simulation domain -def box_write(f,box): +def box_write(f,box,color,thick): xlo,ylo,zlo = box[0],box[1],box[2] xhi,yhi,zhi = box[3],box[4],box[5] - - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,ylo,zlo,xhi,ylo,zlo) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,yhi,zlo,xhi,yhi,zlo) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,ylo,zhi,xhi,ylo,zhi) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,yhi,zhi,xhi,yhi,zhi) - - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,ylo,zlo,xlo,yhi,zlo) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xhi,ylo,zlo,xhi,yhi,zlo) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,ylo,zhi,xlo,yhi,zhi) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xhi,ylo,zhi,xhi,yhi,zhi) - - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,ylo,zlo,xlo,ylo,zhi) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xhi,ylo,zlo,xhi,ylo,zhi) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xlo,yhi,zlo,xlo,yhi,zhi) - print >>f,"3\n%g %g %g 0.3 %g %g %g 0.3 0.8 0.8 0.0" % \ - (xhi,yhi,zlo,xhi,yhi,zhi) + red = color[0] + green = color[1] + blue = color[2] + + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,ylo,zlo,thick,xhi,ylo,zlo,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,yhi,zlo,thick,xhi,yhi,zlo,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,ylo,zhi,thick,xhi,ylo,zhi,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,yhi,zhi,thick,xhi,yhi,zhi,thick,red,green,blue) + + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,ylo,zlo,thick,xlo,yhi,zlo,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xhi,ylo,zlo,thick,xhi,yhi,zlo,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,ylo,zhi,thick,xlo,yhi,zhi,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xhi,ylo,zhi,thick,xhi,yhi,zhi,thick,red,green,blue) + + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,ylo,zlo,thick,xlo,ylo,zhi,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xhi,ylo,zlo,thick,xhi,ylo,zhi,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xlo,yhi,zlo,thick,xlo,yhi,zhi,thick,red,green,blue) + print >>f,"3\n%g %g %g %g %g %g %g %g %g %g %g" % \ + (xhi,yhi,zlo,thick,xhi,yhi,zhi,thick,red,green,blue) # -------------------------------------------------------------------- # compute 3x3 rotation matrix for viewing angle --- /home/sjplimp/oldpizza/src/svg.py 2005-09-14 10:01:11.000000000 -0600 +++ /home/sjplimp/pizza/src/svg.py 2005-09-14 09:57:12.000000000 -0600 @@ -22,6 +22,8 @@ s.trans(x,y) translate by x,y in view window (def = 0,0) s.zoom(0.5) scale image by factor (def = 1) s.box(0/1/2) 0/1/2 = none/variable/fixed box +s.box(0/1/2,"green") set box color +s.box(0/1/2,"red",4) set box edge thickness s.file = "image" file prefix for created images (def = "image") s.thick = 2.0 pixel thickness of black atom border @@ -69,23 +71,23 @@ by default, 100 types are assigned if an atom/bond/tri has type > # defined properties, it becomes type = 1 - -from vizinfo import colors add new color nickname -colors["nickname"] = [R,G,B] RGB values from 0.0 to 1.0 - pre-defined colors are red, green, blue, purple, cyan, yellow, black, white +from vizinfo import colors access color list +print colors list defined color names and RGB values +colors["nickname"] = [R,G,B] set new RGB values from 0 to 255 + + 140 pre-defined colors: red, green, blue, purple, yellow, black, white, etc """ # History # 8/05, Matt Jones (BYU): original version +# 9/05, Steve Plimpton: adjusted box and label attributes # ToDo list # when do aselect with select str while looping N times on same timestep # would not let you grow # of atoms selected # box draw overlays all atoms, needs to be z-clipped # might have to draw as segments and include segments in z-sort -# labels are not using colors from color table -# need to allow color and radius for box lines # Variables # ztheta = vertical angle from z-azis to view from @@ -95,7 +97,9 @@ # distance = characteristic size of simulation scene (largest dim) # file = filename prefix to use for images produced # boxflag = 0/1/2 for drawing simulation box: none/variable/fixed -# bg = color of background +# bxcol = color of box +# bxthick = thickness of box +# bgcol = color of background # amap = settings for atom types # tmap = settings for triangle types # bmap = settings for bond types @@ -124,6 +128,8 @@ self.file = "image" self.boxflag = 0 + self.bxcol = [1,1,0] + self.bxthick = 0.3 self.bgcol = [0,0,0] self.labels = [] self.panflag = 0 @@ -140,9 +146,10 @@ # -------------------------------------------------------------------- - def bg(self,bcolor): + def bg(self,color): from vizinfo import colors - self.bgcol = colors[bcolor] + self.bgcol = [colors[color][0]/255.0,colors[color][1]/255.0, + colors[color][2]/255.0] # -------------------------------------------------------------------- @@ -165,8 +172,13 @@ # -------------------------------------------------------------------- - def box(self,flag): - self.boxflag = flag + def box(self,*args): + self.boxflag = args[0] + if len(args) > 1: + from vizinfo import colors + self.bxcol = [colors[args[1]][0]/255.0,colors[args[1]][1]/255.0, + colors[args[1]][2]/255.0] + if len(args) > 2: self.bxthick = args[2] # -------------------------------------------------------------------- @@ -305,9 +317,11 @@ # -------------------------------------------------------------------- - def label(self,x,y,font,size,color,text): - list = [((x*self.max_x)+(self.max_x/2.0)), - ((self.max_y/2.0)-(y*self.max_y)),font,size,color,text] + def label(self,x,y,font,point,color,text): + from vizinfo import colors + scaledcolor = [colors[color][0]/255.0,colors[color][1]/255.0, + colors[color][2]/255.0] + list = [x,y,fontlist[font],point,scaledcolor,text] self.labels.append(list) # -------------------------------------------------------------------- @@ -519,15 +533,20 @@ color[0]*255,color[1]*255,color[2]*255) elif flag == 1: - for label in self.labels: - print >>f,' %s ' % \ - (label[0],label[1],label[3],fontlist[label[2]],label[4],label[5]) + x = (obj[0]*self.max_x) + (self.max_x/2.0) + y = (self.max_y/2.0) - (obj[1]*self.max_y) + color = obj[4] + print >>f,' %s ' % \ + (x,y,obj[3],obj[2],color[0]*255,color[1]*255,color[2]*255, + color[0]*255,color[1]*255,color[2]*255,obj[5]) elif flag == 2: + color = self.bxcol for [i,j] in [[0,1],[0,2],[1,3],[2,3],[4,5],[4,6], [5,7],[6,7],[0,4],[1,5],[2,6],[3,7]]: - print >>f,'' % \ - (obj[i][2],obj[i][3],obj[j][2],obj[j][3],"yellow",1) + print >>f,'' % \ + (obj[i][2],obj[i][3],obj[j][2],obj[j][3], + color[0]*255,color[1]*255,color[2]*255,self.bxthick*self.factor) # -------------------------------------------------------------------- --- /home/sjplimp/oldpizza/src/vizinfo.py 2005-09-07 10:13:09.000000000 -0600 +++ /home/sjplimp/pizza/src/vizinfo.py 2005-09-14 08:53:19.000000000 -0600 @@ -10,9 +10,9 @@ # History # 8/05, Matt Jones (BYU): original version +# 9/05, Steve Plimpton: added 140-color table # ToDo list -# get a full set of colors > 8 # Variables @@ -83,7 +83,8 @@ # set color for each type # if list lengths match, set directly, else interpolate - + # convert final color from 0-255 to 0.0-1.0 + ntypes = len(ids) nrgbs = len(rgbs) @@ -92,9 +93,9 @@ if rgbs[0] == "loop": list = colors.keys() - col = colors[list[i % len(colors)]] + red,green,blue = colors[list[i % len(colors)]] elif ntypes == nrgbs: - col = colors[rgbs[i]] + red,green,blue = colors[rgbs[i]] else: r = i/float(ntypes-1) * float(nrgbs-1) jlo = int(r) @@ -106,11 +107,12 @@ red = clo[0] + delta*(chi[0]-clo[0]) green = clo[1] + delta*(chi[1]-clo[1]) blue = clo[2] + delta*(chi[2]-clo[2]) - col = [red,green,blue] - if which == "atom": self.acolor[id] = col - if which == "bond": self.bcolor[id] = col - if which == "tri": self.tcolor[id] = col + color = [red/255.0,green/255.0,blue/255.0] + + if which == "atom": self.acolor[id] = color + if which == "bond": self.bcolor[id] = color + if which == "tri": self.tcolor[id] = color # -------------------------------------------------------------------- # set color alpha @@ -237,14 +239,147 @@ return len(array) # -------------------------------------------------------------------- -# dictionary of color names and RGB values +# dictionary of 140 color names and associated RGB values colors = {} -colors["red"] = [1.0, 0.0, 0.0] -colors["green"] = [0.0, 1.0, 0.0] -colors["blue"] = [0.0, 0.0, 1.0] -colors["purple"] = [1.0, 0.0, 1.0] -colors["cyan"] = [0.0, 1.0, 1.0] -colors["yellow"] = [1.0, 1.0, 0.0] -colors["black"] = [0.0, 0.0, 0.0] -colors["white"] = [1.0, 1.0, 1.0] + +colors["aliceblue"] = [240, 248, 255] +colors["antiquewhite"] = [250, 235, 215] +colors["aqua"] = [0, 255, 255] +colors["aquamarine"] = [127, 255, 212] +colors["azure"] = [240, 255, 255] +colors["beige"] = [245, 245, 220] +colors["bisque"] = [255, 228, 196] +colors["black"] = [0, 0, 0] +colors["blanchedalmond"] = [255, 255, 205] +colors["blue"] = [0, 0, 255] +colors["blueviolet"] = [138, 43, 226] +colors["brown"] = [165, 42, 42] +colors["burlywood"] = [222, 184, 135] +colors["cadetblue"] = [95, 158, 160] +colors["chartreuse"] = [127, 255, 0] +colors["chocolate"] = [210, 105, 30] +colors["coral"] = [255, 127, 80] +colors["cornflowerblue"] = [100, 149, 237] +colors["cornsilk"] = [255, 248, 220] +colors["crimson"] = [220, 20, 60] +colors["cyan"] = [0, 255, 255] +colors["darkblue"] = [0, 0, 139] +colors["darkcyan"] = [0, 139, 139] +colors["darkgoldenrod"] = [184, 134, 11] +colors["darkgray"] = [169, 169, 169] +colors["darkgreen"] = [0, 100, 0] +colors["darkkhaki"] = [189, 183, 107] +colors["darkmagenta"] = [139, 0, 139] +colors["darkolivegreen"] = [85, 107, 47] +colors["darkorange"] = [255, 140, 0] +colors["darkorchid"] = [153, 50, 204] +colors["darkred"] = [139, 0, 0] +colors["darksalmon"] = [233, 150, 122] +colors["darkseagreen"] = [143, 188, 143] +colors["darkslateblue"] = [72, 61, 139] +colors["darkslategray"] = [47, 79, 79] +colors["darkturquoise"] = [0, 206, 209] +colors["darkviolet"] = [148, 0, 211] +colors["deeppink"] = [255, 20, 147] +colors["deepskyblue"] = [0, 191, 255] +colors["dimgray"] = [105, 105, 105] +colors["dodgerblue"] = [30, 144, 255] +colors["firebrick"] = [178, 34, 34] +colors["floralwhite"] = [255, 250, 240] +colors["forestgreen"] = [34, 139, 34] +colors["fuchsia"] = [255, 0, 255] +colors["gainsboro"] = [220, 220, 220] +colors["ghostwhite"] = [248, 248, 255] +colors["gold"] = [255, 215, 0] +colors["goldenrod"] = [218, 165, 32] +colors["gray"] = [128, 128, 128] +colors["green"] = [0, 128, 0] +colors["greenyellow"] = [173, 255, 47] +colors["honeydew"] = [240, 255, 240] +colors["hotpink"] = [255, 105, 180] +colors["indianred"] = [205, 92, 92] +colors["indigo"] = [75, 0, 130] +colors["ivory"] = [255, 240, 240] +colors["khaki"] = [240, 230, 140] +colors["lavender"] = [230, 230, 250] +colors["lavenderblush"] = [255, 240, 245] +colors["lawngreen"] = [124, 252, 0] +colors["lemonchiffon"] = [255, 250, 205] +colors["lightblue"] = [173, 216, 230] +colors["lightcoral"] = [240, 128, 128] +colors["lightcyan"] = [224, 255, 255] +colors["lightgoldenrodyellow"] = [250, 250, 210] +colors["lightgreen"] = [144, 238, 144] +colors["lightgrey"] = [211, 211, 211] +colors["lightpink"] = [255, 182, 193] +colors["lightsalmon"] = [255, 160, 122] +colors["lightseagreen"] = [32, 178, 170] +colors["lightskyblue"] = [135, 206, 250] +colors["lightslategray"] = [119, 136, 153] +colors["lightsteelblue"] = [176, 196, 222] +colors["lightyellow"] = [255, 255, 224] +colors["lime"] = [0, 255, 0] +colors["limegreen"] = [50, 205, 50] +colors["linen"] = [250, 240, 230] +colors["magenta"] = [255, 0, 255] +colors["maroon"] = [128, 0, 0] +colors["mediumaquamarine"] = [102, 205, 170] +colors["mediumblue"] = [0, 0, 205] +colors["mediumorchid"] = [186, 85, 211] +colors["mediumpurple"] = [147, 112, 219] +colors["mediumseagreen"] = [60, 179, 113] +colors["mediumslateblue"] = [123, 104, 238] +colors["mediumspringgreen"] = [0, 250, 154] +colors["mediumturquoise"] = [72, 209, 204] +colors["mediumvioletred"] = [199, 21, 133] +colors["midnightblue"] = [25, 25, 112] +colors["mintcream"] = [245, 255, 250] +colors["mistyrose"] = [255, 228, 225] +colors["moccasin"] = [255, 228, 181] +colors["navajowhite"] = [255, 222, 173] +colors["navy"] = [0, 0, 128] +colors["oldlace"] = [253, 245, 230] +colors["olive"] = [128, 128, 0] +colors["olivedrab"] = [107, 142, 35] +colors["orange"] = [255, 165, 0] +colors["orangered"] = [255, 69, 0] +colors["orchid"] = [218, 112, 214] +colors["palegoldenrod"] = [238, 232, 170] +colors["palegreen"] = [152, 251, 152] +colors["paleturquoise"] = [175, 238, 238] +colors["palevioletred"] = [219, 112, 147] +colors["papayawhip"] = [255, 239, 213] +colors["peachpuff"] = [255, 239, 213] +colors["peru"] = [205, 133, 63] +colors["pink"] = [255, 192, 203] +colors["plum"] = [221, 160, 221] +colors["powderblue"] = [176, 224, 230] +colors["purple"] = [128, 0, 128] +colors["red"] = [255, 0, 0] +colors["rosybrown"] = [188, 143, 143] +colors["royalblue"] = [65, 105, 225] +colors["saddlebrown"] = [139, 69, 19] +colors["salmon"] = [250, 128, 114] +colors["sandybrown"] = [244, 164, 96] +colors["seagreen"] = [46, 139, 87] +colors["seashell"] = [255, 245, 238] +colors["sienna"] = [160, 82, 45] +colors["silver"] = [192, 192, 192] +colors["skyblue"] = [135, 206, 235] +colors["slateblue"] = [106, 90, 205] +colors["slategray"] = [112, 128, 144] +colors["snow"] = [255, 250, 250] +colors["springgreen"] = [0, 255, 127] +colors["steelblue"] = [70, 130, 180] +colors["tan"] = [210, 180, 140] +colors["teal"] = [0, 128, 128] +colors["thistle"] = [216, 191, 216] +colors["tomato"] = [253, 99, 71] +colors["turquoise"] = [64, 224, 208] +colors["violet"] = [238, 130, 238] +colors["wheat"] = [245, 222, 179] +colors["white"] = [255, 255, 255] +colors["whitesmoke"] = [245, 245, 245] +colors["yellow"] = [255, 255, 0] +colors["yellowgreen"] = [154, 205, 50] --- /home/sjplimp/oldpizza/doc/raster.txt 2005-09-07 10:13:10.000000000 -0600 +++ /home/sjplimp/pizza/doc/raster.txt 2005-09-14 09:55:52.000000000 -0600 @@ -58,11 +58,14 @@ setting. Thus displayed colors can be keyed to atom velocity or other properties. -Colors are specified with a string, e.g. "red". The 8 pre-defined -colors are listed below. Additional colors can be defined by -importing from the vizinfo module and assigning a nickname to an RGB +Colors are specified with a string, e.g. "red". There are 140 +pre-defined colors from "this WWW page"_colortable which can be +examined by importing the "colors" variable from "vizinfo". New +colors can be defined by assigning a nickname of your choice to an RGB triplet, as described below. +:link(colortable,http://www.oreilly.com/catalog/wdnut/excerpt/color_names.html) + [Usage:] r = raster(d) create Raster3d wrapper for data in d :pre @@ -76,6 +79,8 @@ r.trans(x,y) translate by x,y in view window (def = 0,0) r.zoom(0.5) scale image by factor (def = 1) r.box(0/1/2) 0/1/2 = none/variable/fixed box +r.box(0/1/2,"green") set box color +r.box(0/1/2,"red",4) set box edge thickness r.file = "image" file prefix for created images (def = "image") :pre r.show(N) show image of snapshot at timestep N :pre @@ -123,10 +128,11 @@ by default, 100 types are assigned if an atom/bond/tri has type > # defined properties, it becomes type = 1 :pre -from vizinfo import colors add new color nickname -colors\["nickname"\] = \[R,G,B\] RGB values from 0.0 to 1.0 :pre +from vizinfo import colors access color list +print colors list defined color names and RGB values +colors\["nickname"\] = \[R,G,B\] set new RGB values from 0 to 255 :pre - pre-defined colors are red, green, blue, purple, cyan, yellow, black, white :pre + 140 pre-defined colors: red, green, blue, purple, yellow, black, white, etc :pre [Related tools:] --- /home/sjplimp/oldpizza/doc/raster.html 2005-09-07 10:13:10.000000000 -0600 +++ /home/sjplimp/pizza/doc/raster.html 2005-09-14 09:56:26.000000000 -0600 @@ -61,11 +61,14 @@ setting. Thus displayed colors can be keyed to atom velocity or other properties.

-

Colors are specified with a string, e.g. "red". The 8 pre-defined -colors are listed below. Additional colors can be defined by -importing from the vizinfo module and assigning a nickname to an RGB +

Colors are specified with a string, e.g. "red". There are 140 +pre-defined colors from this WWW page which can be +examined by importing the "colors" variable from "vizinfo". New +colors can be defined by assigning a nickname of your choice to an RGB triplet, as described below.

+ +

Usage:

r = raster(d)               create Raster3d wrapper for data in d 
@@ -79,6 +82,8 @@
 r.trans(x,y)                translate by x,y in view window (def = 0,0)
 r.zoom(0.5)                 scale image by factor (def = 1)
 r.box(0/1/2)                0/1/2 = none/variable/fixed box
+r.box(0/1/2,"green")        set box color
+r.box(0/1/2,"red",4)        set box edge thickness
 r.file = "image"            file prefix for created images (def = "image") 
 
r.show(N)                   show image of snapshot at timestep N 
@@ -126,10 +131,11 @@
 
  by default, 100 types are assigned
   if an atom/bond/tri has type > # defined properties, it becomes type = 1 
 
-
from vizinfo import colors         add new color nickname
-colors["nickname"] = [R,G,B]       RGB values from 0.0 to 1.0 
+
from vizinfo import colors         access color list
+print colors                       list defined color names and RGB values
+colors["nickname"] = [R,G,B]       set new RGB values from 0 to 255 
 
-
  pre-defined colors are red, green, blue, purple, cyan, yellow, black, white 
+
  140 pre-defined colors: red, green, blue, purple, yellow, black, white, etc 
 

Related tools:

--- /home/sjplimp/oldpizza/doc/svg.txt 2005-09-14 10:01:11.000000000 -0600 +++ /home/sjplimp/pizza/doc/svg.txt 2005-09-14 09:56:16.000000000 -0600 @@ -56,11 +56,14 @@ setting. Thus displayed colors can be keyed to atom velocity or other properties. -Colors are specified with a string, e.g. "red". The 8 pre-defined -colors are listed below. Additional colors can be defined by -importing from the vizinfo module and assigning a nickname to an RGB +Colors are specified with a string, e.g. "red". There are 140 +pre-defined colors from "this WWW page"_colortable which can be +examined by importing the "colors" variable from "vizinfo". New +colors can be defined by assigning a nickname of your choice to an RGB triplet, as described below. +:link(colortable,http://www.oreilly.com/catalog/wdnut/excerpt/color_names.html) + [Usage:] s = svg(d) create SVG object for data in d :pre @@ -74,6 +77,8 @@ s.trans(x,y) translate by x,y in view window (def = 0,0) s.zoom(0.5) scale image by factor (def = 1) s.box(0/1/2) 0/1/2 = none/variable/fixed box +s.box(0/1/2,"green") set box color +s.box(0/1/2,"red",4) set box edge thickness s.file = "image" file prefix for created images (def = "image") s.thick = 2.0 pixel thickness of black atom border :pre @@ -122,10 +127,11 @@ by default, 100 types are assigned if an atom/bond/tri has type > # defined properties, it becomes type = 1 :pre -from vizinfo import colors add new color nickname -colors\["nickname"\] = \[R,G,B\] RGB values from 0.0 to 1.0 :pre +from vizinfo import colors access color list +print colors list defined color names and RGB values +colors\["nickname"\] = \[R,G,B\] set new RGB values from 0 to 255 :pre - pre-defined colors are red, green, blue, purple, cyan, yellow, black, white :pre + 140 pre-defined colors: red, green, blue, purple, yellow, black, white, etc :pre [Related tools:] --- /home/sjplimp/oldpizza/doc/svg.html 2005-09-14 10:01:11.000000000 -0600 +++ /home/sjplimp/pizza/doc/svg.html 2005-09-14 09:56:26.000000000 -0600 @@ -59,11 +59,14 @@ setting. Thus displayed colors can be keyed to atom velocity or other properties.

-

Colors are specified with a string, e.g. "red". The 8 pre-defined -colors are listed below. Additional colors can be defined by -importing from the vizinfo module and assigning a nickname to an RGB +

Colors are specified with a string, e.g. "red". There are 140 +pre-defined colors from this WWW page which can be +examined by importing the "colors" variable from "vizinfo". New +colors can be defined by assigning a nickname of your choice to an RGB triplet, as described below.

+ +

Usage:

s = svg(d)                  create SVG object for data in d 
@@ -77,6 +80,8 @@
 s.trans(x,y)                translate by x,y in view window (def = 0,0)
 s.zoom(0.5)                 scale image by factor (def = 1)
 s.box(0/1/2)                0/1/2 = none/variable/fixed box
+s.box(0/1/2,"green")        set box color
+s.box(0/1/2,"red",4)        set box edge thickness
 s.file = "image"            file prefix for created images (def = "image")
 s.thick = 2.0               pixel thickness of black atom border 
 
@@ -125,10 +130,11 @@
  by default, 100 types are assigned
   if an atom/bond/tri has type > # defined properties, it becomes type = 1 
 
-
from vizinfo import colors         add new color nickname
-colors["nickname"] = [R,G,B]       RGB values from 0.0 to 1.0 
+
from vizinfo import colors         access color list
+print colors                       list defined color names and RGB values
+colors["nickname"] = [R,G,B]       set new RGB values from 0 to 255 
 
-
  pre-defined colors are red, green, blue, purple, cyan, yellow, black, white 
+
  140 pre-defined colors: red, green, blue, purple, yellow, black, white, etc 
 

Related tools:

--- /home/sjplimp/oldpizza/examples/test_raster.py 2005-09-07 10:13:10.000000000 -0600 +++ /home/sjplimp/pizza/examples/test_raster.py 2005-09-14 09:42:15.000000000 -0600 @@ -16,11 +16,11 @@ a1 = animate("tmp0*png") from vizinfo import colors -colors["gray"] = [0.5,0.5,0.5] r.acol([1,4,6,8,9],["gray","red","blue","green","yellow"]) r.arad(range(9),0.3) -r.label(0.2,0.4,'h',15,"red","test label") +r.label(0.2,0.4,'h',15,"red","test label #1") +r.label(-0.2,-0.4,'h',15,"yellow","test label #2") print "kill image window when ready to contine ..." r.show(0) --- /home/sjplimp/oldpizza/examples/test_svg.py 2005-09-07 10:13:10.000000000 -0600 +++ /home/sjplimp/pizza/examples/test_svg.py 2005-09-14 09:50:03.000000000 -0600 @@ -15,11 +15,11 @@ s.all() from vizinfo import colors -colors["gray"] = [0.5,0.5,0.5] s.acol([1,4,6,8,9],["gray","red","blue","green","yellow"]) s.arad(range(9),0.3) -s.label(0.2,0.4,'h',15,"red","test label") +s.label(0.2,0.4,'h',15,"red","test label #1") +s.label(-0.2,-0.4,'h',15,"yellow","test label #2") print "kill image window when ready to contine ..." s.show(0)