I want to make a model that represents protein surface with some features and use b-factor column to draw a color gradient. I searched online a while and had steps showing here, also, an picture showing my result.
Steps.
1. download data2bfactor.py (http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/)
2. make a file that have such information:
(res chain AA(capitalized) b-factor) <– skip this line
1 A MET 0.0
2 A GLU 0.1
3 A LYS 0.2
……………………
3. open pymol, load the PDB, and draw some residues in surface
4. import the b-factor into the PDB by typing:
data2b_res ‘selection’, ‘b-factor file’
5. use “spectrum” to draw the color gradient:
spectrum b, yellow_blue,resi 10-130,minimum=0, maximum=1
6. The example is showing here:

the combinations of color gradient provided by pymol are:
blue_green
blue_magenta
blue_red
blue_white_green
blue_white_magenta
blue_white_red
blue_white_yellow
blue_yellow
cbmr
cyan_magenta
cyan_red
cyan_white_magenta
cyan_white_red
cyan_white_yellow
cyan_yellow
gcbmry
green_blue
green_magenta
green_red
green_white_blue
green_white_magenta
green_white_red
green_white_yellow
green_white_red
green_white_yellow
green_yellow
green_yellow_red
magenta_blue
magenta_cyan
magenta_green
magenta_white_blue
magenta_white_cyan
magenta_white_green
magenta_white_yellow
magenta_yellow
rainbow
rainbow2
rainbow2_rev
rainbow_cycle
rainbow_cycle_rev
rainbow_rev
red_blue
red_cyan
red_green
red_white_blue
red_white_cyan
red_white_green
red_white_yellow
red_yellow
red_yellow_green
rmbc
yellow_blue
yellow_cyan
yellow_cyan_white
yellow_green
yellow_magenta
yellow_red
yellow_white_blue
yellow_white_green
yellow_white_magenta
yellow_white_red
yrmbcg
