From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Sep 22 2004 - 17:07:11 CDT

Chun-Wei,
  Unless the captions you have in mind are fairly simple, the best
method for doing this would be to add such text captions in an external
image editing program such as Adobe Photoshop/Illustrator, or GIMP,
depending on what OS you're running. If you are looking to add
very simple labels (or want to place them in movies made by VMD) you
can use the "draw text" or "graphics text" commands described in the
VMD User's Guide for this purpose. I suspect that using an external
program is the best method in most cases since they are very flexible
and provide for easy to customize fonts, etc. Here's a simple script
that adds a label to a residue, as an example however:
 
proc labelresidue { residueselection labeltext } {
  set sel [atomselect top "$residueselection and name CA"]
  set positions [$sel get {x y z}]
  set num [$sel num]
  for {set i 0} {$i < $num} {incr i} {
    draw text [lindex $positions $i] $labeltext
  }
  $sel delete
}
 

  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Sep 22, 2004 at 05:54:38PM -0400, cpao_at_Princeton.EDU wrote:
> Hi
>
> I have a problem with rendering snapshot images. How can I add small
> caption containing information such like numbers of atoms or index of
> frames to the images rendered?
> thanks
>
> Chun-Wei

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078