# Create tiled text labels in ChimeraX using the names of the currently opened structures. from chimerax.core.commands import run #rows, columns = 6, 6 #rows, columns = 4, 4 rows, columns = 5, 5 from chimerax.atomic import all_atomic_structures for i, s in enumerate(all_atomic_structures(session)): # id = s.name.split('_')[2] id = s.name.split('.')[0] x = (i % columns + .3)/columns y = 1 - (i // columns + .5)/rows - 0.5/rows run(session, f'2dlabel create {id} text {id} xpos {x} ypos {y} bg white size 12')