colorhue.xm

来自「一个很好的分子动力学程序」· XM 代码 · 共 73 行

XM
73
字号
########################################################################                                                                     ##  Example:  Plotting Color                                           ##                                                                     #########################################################################                                                                     ##    XMD can produce color plots on a color postscript printer.       ##  There are two methods of specifying color, RGB (red green blue)    # #  and HSB (hue saturation brighness).  The following example         ##  draw 64 atoms of varying hue, saturation and brightness            ##                                                                     ########################################################################debug on###  Make 3D simple cubic lattice#box 4 4 4particle 11  0.50 0.50 0.50dup  3  1 0 0dup  3  0 1 0dup  3  0 0 1##  Set up plot parameters required by both plots## Postscript Printerplot device postscript# Number of pagesplot page 1# Number of layersplot layer 4# Orientation of plot (vertical axis y, horizontal axis x)plot orient y/x##  Give each layer  its own hue#  Give each column its own saturation#  Give each row    its own brigtness##   Assign atom colors#   Select each atom in sequence, and assign hue#   from 0 to 63/64.  Saturation  and Brightness are 1.calc  index = 0repeat 4   repeat 4		repeat 4			calc hue   = index / 64  			calc index = index + 1			#   Select each atom in sequence			select index index			#   Assign hue, saturation and brightness 			plot  symbol fill  hsb   HUE  1 1  cir  0.125		end	endend##  Plot## Plot labellabel 8EXAMPLE: colorhue.xmAll atoms have saturation and brightness value of 1.Hue values vary from 0 to 63/64 in steps of 1/64.# plot to output postscript fileplot write colorhue.ps

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?