[chimerax-users] Subscript in 2Dlabels

Elaine Meng meng at cgl.ucsf.edu
Wed Jul 8 14:41:21 PDT 2020


Hi Derek,
Certain specific sub/superscripts are available as Unicode, which can be included as described in the "2dlabels" page:
<http://rbvi.ucsf.edu/chimerax/docs/user/commands/2dlabels.html#create>
<https://unicode-table.com/en/blocks/superscripts-and-subscripts/>

For example, this command would put a plus sign as a superscript on "hello":

2dlab text hello\U+207A

However, for arbitrary sub/superscripts not available as Unicode, there is only the somewhat unpleasant hack of making a smaller label and trying to get it in the right place relative to the other label.

It is not bad if you first create the label and then just use the "move label" mouse mode to drag it into place.  
<http://rbvi.ucsf.edu/chimerax/docs/user/tools/mousemodes.html>

However, if you want to do it all in a ChimeraX command script it is a little tedious to keep reissuing the command with slightly different position ("xpos" and "ypos" values) until you get it in the right place and then can put those values into your script.

It will be easier once we have a ChimeraX 2D Labels GUI that shows the current xpos,ypos values after the label is dragged with the mouse.  However, for now, only Chimera has a 2D Labels GUI.

Another possibility is to have  a session in which the labels are all pre-made but hidden and then just use the script to show and hide these pre-existing labels.  However, I generally prefer to do it all in a script, if possible.

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco


> On Jul 8, 2020, at 9:31 AM, Derek Harris <derek.harris at aggiemail.usu.edu> wrote:
> 
> Is there a way, or code, to do sub/superscripts in a 2Dlabel?




More information about the ChimeraX-users mailing list