# PyMOL commands cheat sheet, runnable in the browser

> A PyMOL commands cheat sheet built around one structure, HIV-1 protease with its inhibitor (1HSG): fetch, show, color, select, distance, align, label, png, ray and scripts, each runnable in the browser.

Most PyMOL tutorials start with an installer. The commands themselves are short, though, and you can type them in a browser tab. The [PDB viewer](/app/pdb-viewer) has a command line that reads PyMOL syntax, so `fetch`, `select`, `color`, `distance`, `align` and `png` mean what they mean in PyMOL, and this page runs each of them on one structure.

The structure is [1HSG](https://www.rcsb.org/structure/1HSG), HIV-1 protease bound to the inhibitor indinavir, which the entry calls L-735,524 and the file labels `MK1`. It is a small homodimer of two 99-residue chains with one ligand, so every command below does something you can see. The second structure for the alignment is [1HVR](https://www.rcsb.org/structure/1HVR), the same enzyme with a different inhibitor.

Work through the sections in order and you end with a figure, a measured contact list, an alignment and a script. Each block can be pasted whole into the command line. Commands that PyMOL has and the viewer does not are collected in [one short section](#commands-that-do-not-run-in-the-viewer) instead of mixed into the blocks.

## How to type PyMOL commands in the browser

1. Open the [PDB viewer](/app/pdb-viewer).
2. Click **Command line** at the bottom of the canvas. A line with a log above it opens.
3. Type `fetch 1hsg` and press Enter. The structure loads and the log says `Fetched 1hsg.`
4. Type the next command. The up and down arrows recall earlier lines, and Tab completes command names, object names, colours and settings.

You can also type a command into the search box at the top. A line whose first word is a command and that has arguments, such as `show sticks, organic`, runs as a command there, and a leading `>` forces it. Separate several commands on one line with `;`, or paste several lines at once to run them as one script and one undo step.

Selections follow PyMOL's syntax, including object names (`1hsg and chain A`) and the slash form (`/1hsg//A/25/CA`). The log keeps recent commands and their output, which is where RMSD values and atom counts appear.

## The commands you will use most

  <caption><strong>Table 1. The commonest PyMOL commands and what each does.</strong> Meanings from the PyMOL Wiki; every command in the table is used below on 1HSG. Sources: PyMOL Wiki (2026).</caption>
  <thead>
    <tr>
      <th scope="col">Command</th>
      <th scope="col">What it does</th>
      <th scope="col">Example</th>
    </tr>
  </thead>
  <tbody>
    <tr><td><code>fetch</code></td><td>Downloads an entry by its PDB code and loads it</td><td><code>fetch 1hsg</code></td></tr>
    <tr><td><code>show</code>, <code>hide</code>, <code>as</code></td><td>Turn representations on or off for a selection; <code>as</code> shows one and hides the rest</td><td><code>show sticks, organic</code></td></tr>
    <tr><td><code>color</code></td><td>Sets the colour of an object or selection</td><td><code>color gray80, polymer</code></td></tr>
    <tr><td><code>util.cbc</code></td><td>Colours each chain differently</td><td><code>util.cbc</code></td></tr>
    <tr><td><code>spectrum</code></td><td>Colours by a property such as <code>b</code> along a palette</td><td><code>spectrum b, blue_white_red</code></td></tr>
    <tr><td><code>select</code></td><td>Stores a named selection from an atom expression</td><td><code>select site, resn MK1</code></td></tr>
    <tr><td><code>distance</code></td><td>Measures distances; <code>mode=2</code> keeps polar contacts only</td><td><code>distance hb, site, pocket, mode=2</code></td></tr>
    <tr><td><code>label</code></td><td>Writes an expression per atom as a label</td><td><code>label name CA, resn + resi</code></td></tr>
    <tr><td><code>align</code></td><td>Sequence alignment, then a fit with outlier rejection</td><td><code>align mobile, target</code></td></tr>
    <tr><td><code>super</code></td><td>Structure-based fit that does not depend on sequence</td><td><code>super mobile, target</code></td></tr>
    <tr><td><code>cealign</code></td><td>CE structural alignment; target comes first</td><td><code>cealign target, mobile</code></td></tr>
    <tr><td><code>zoom</code>, <code>orient</code></td><td>Frame a selection, or line its principal axes up with the screen</td><td><code>zoom site, 8</code></td></tr>
    <tr><td><code>png</code>, <code>ray</code></td><td>Save the view as an image; trace rays for lighting</td><td><code>png figure.png, 10cm, dpi=300</code></td></tr>
  </tbody>

## How to load a structure and change how it looks

`fetch` takes a PDB code, saves the file and loads it as an object named after the code. `hide everything` clears the default look, and `show` then switches on exactly what you ask for.
```text
fetch 1hsg
hide everything
show cartoon
util.cbc
show sticks, organic
util.cbag organic
```
`organic` is PyMOL's keyword for non-polymer organic molecules, so here it means the inhibitor. `util.cbc` colours each chain a different colour. `util.cbag organic` then colours the ligand's non-carbon atoms by element and leaves its carbons green, the PyMOL default.

![The PDB viewer with HIV-1 protease (1HSG) as a cartoon, chain A green and chain B teal, the inhibitor indinavir as green sticks in the cleft between them, and the command line at the bottom showing show sticks, organic and util.cbag organic with their replies](/images/guides/pymol-commands/load-and-style.webp '**Figure 1. 1HSG after the six commands above.** The log under the canvas answers each line, for example `Showing sticks for 45 atoms.` for the inhibitor. A final `zoom` framed the whole protein.')

[Open this view in the PDB viewer](https://proteiniq.io/app/pdb-viewer#session=7Rppc-I68q9s6bPM821M1ftAQg5yEAK5ZlKplLAFKJElI8kcmeK_b0kGgpkwk_d2dmu3dr4Y1JZafXer5W-ApKABerhHEzJ96HfPrYEazma3mI6aAIIUKQQa34ASGJe_iMkhF5kEjcdvIEcCMwUawPpTcK7-tAB8n4IFaIBBQWhqEVbT7wHUK5Be_G0JgcDD6tIpFpJwBhqgez0-Saad165ny7fnbnrUz8W0CZbwM3tm0sppMSKslvIZoxyl2xuDQlDQAGOlctn444-Mp5jKmkjkoMbF6A9nLEe1QUKGAAKKBljP1TAAAZEHhCGxAA0lCrxhYHF-SU7uJ_7Xr90XJLvjaXq_aI0q7Ijs5MtJ27NOv369kt7JGX9ReTCrsrMXzT7mciQktkpKt8UqFVJGWUSejLlUO-ROz8YZPXyJF9JZXLy5Y7f5bM2q5KKrw-zq8Ll_tIi8emsoHm5pJ9khdy-afeQqgV5worhYWEPBMyvLvie9pDD2b3wxGb9eNA_OR-0zZ9LiLee6QmG-CBbnr60H-6B_e-adTied3uLiukrhXjT7KDSmUBL3TmzFdMyMNkvxHDTsDb2z095Bp35fPMj-MRdzcXkffAlmFXrfhvPJab1_8BbfR8GwNzsZvuL5jj3vRbOP3qSQSgvSkJ0LnmOhCJYVilGheFMplIxB4_EJgq1p-q1cZM8kfebDocRKQ6aIFni1cAwa9sYJ7OUSAlKyvpmmZZCh-fP38OVGOi8Wvvfdo-ZdZ9h5u03uZ5fTm69Ve-Oz86Ltpk6r6LXotN-f9VjnYUc6e9Hsk45UokhUIfDK3LSUKqJRi9xwylCGtdFLibMBrSrcREdHB8I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8R6fpBV4u7tfJ_XwXs_q6Af1fAH1TAWtOHmwgVeDr1leovc4C7drT1F2HIfBiVlW6TcMGwANXPKE9JmmK28x3lzfzqq-g5Vmt41Ldeuq1wlPcW1fsIchENjy8TxtVleu5GzqS4-lKMwLKsSFCGhflgKilE6bTlB4ZahliYelWbPQRDPtXMRfXA06nb8-LI9-sefBd149EJaqEdR7ETRk499OO6B12_ZsdhGMV-XK8HrhNCP67FvhtHdTeMvNgOdYAtcuMljvESpT_xUJ9F59bC2HFDLwzjum3bsftUFqWFBA0vrNl2FLuu7dteGPvh-lX55ZNT84J65AS-54R24Nu-5lKXykEZGI7RppDPCOuYMOqY_-aNNkzjP4b9vlqYC84yHKhSeasEesyTYvVxabqqOdrsUlt6YNvLfwI).

## How to colour in PyMOL

`color name, selection` colours whatever you select. It accepts a colour name, `0xRRGGBB` and `atomic`, and the selection defaults to everything. `util.cbc` is the one-word way to give every chain its own colour, and `spectrum` colours along a palette by an atom property. In the viewer the colour names, `#RRGGBB`, `[r, g, b]` and `set_color` all work.
```text
color gray80, polymer
color tv_orange, chain B and polymer
color atomic, organic
```
The first line turns both chains grey, the second recolours chain B, and the third puts the ligand back to element colours. Colour names such as `gray80` and `tv_orange` are PyMOL's own.

## How to select atoms

`select name, expression` stores a named selection, and later commands can use the name in place of an expression. With one argument it names the selection `sele`. The expression language combines keywords with `and`, `or` and `not`, and adds spatial operators such as `within`, which picks atoms inside a distance of another selection, and `byres`, which grows a selection to whole residues.
```text
select site, resn MK1
select pocket, byres (polymer within 4 of site)
show sticks, pocket
```
`site` is the inhibitor and `pocket` is every protein residue with an atom within 4 Å of it. Ask the viewer how large each one is with `count_atoms site` and `count_atoms pocket`. On 1HSG the log answers 45 atoms for `site`, the whole of indinavir without hydrogens, and 258 atoms for `pocket`, 36 residues across both chains.

## How to measure distances and find polar contacts

`distance name, selection1, selection2` draws dashed lines between two selections. Mode 2 keeps only polar contacts, pairs of donor and acceptor atoms close enough to hydrogen bond. In the viewer, mode 2 considers nitrogen and oxygen atoms and a 3.6 Å limit unless you give a cutoff.
```text
distance hb, site, pocket, mode=2
label pocket and name CA, resn + resi
set label_size, 14
zoom site, 8
```
The `label` line writes residue name and number on the alpha carbon of each pocket residue. `resn + resi` is an expression evaluated for every selected atom, and the viewer accepts the same properties, strings and arithmetic you would use in PyMOL. `zoom site, 8` frames the ligand with an 8 Å border.

The log answers `hb: 9 polar contacts within 3.6 Å.` The central hydroxyl of indinavir, atom `O2`, sits between the two catalytic aspartates: `distance chk, resn MK1 and name O2, resi 25 and name OD1+OD2` finds four distances from 2.63 to 3.04 Å, one to each carboxylate oxygen of Asp25 in both chains.

![The PDB viewer zoomed on the 1HSG binding site: chain A grey and chain B orange as cartoon, the pocket residues as sticks in the same colours, indinavir with green carbons in the middle, green dashed polar contacts, and residue labels such as VAL82, PRO81, ILE50 and LEU76 on the alpha carbons](/images/guides/pymol-commands/pocket-contacts.webp '**Figure 2. The indinavir pocket in 1HSG.** Pocket residues in sticks, polar contacts dashed in green and each residue labelled on its alpha carbon. The colours come from the colouring block in the previous section, with `util.cbag organic` to keep the ligand carbons green.')

[Open this view in the PDB viewer](https://proteiniq.io/app/pdb-viewer#session=7X3XkqPI1u6r_ME11MabivgvkJD33nR0KBJIBBJOCUhCE3133ua81XmSE4nKiW5N92h3zWhCXBQlkiRX2u9ba6XhD8IxiWdi25x2T_tjxWZEfaYw5mCNNtKAIAkTxIB4_oOIEYTn_8CPrAB5EfH85Q8iBAj6MfFMUP-LgiD-X4og36NARDwTeuK4JuX4T_g5QeI3AH75j28kgaB1-eoeosgJfOKZ6A_smrHvbvscHZ1WfbMyCtFeJb6RvyLTi6jQTdaO_2QGB98NgPlRMJEgl3gm7DgOo-f__McLTOhGT8iI9KcArf_D2NH6STcciyAJF-gQx8VhBEk4UcnxAUqJ5xgl8K0AqaGVu9XqcjSf1vX-phwND83R4KI4e8_kG0atR1uTxD8OgCauNrXDZXGuJnOtcCFAEaTOOf1YrVEM4qyxnKhmB1Gcy-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GrS4xPaFWtn11fFhtIp56qa1TSq7gj0z2XbaSZnujJmFsUzzR99dlVZgaIGhd46h4_pQvhc9dKB2NXd_qpzs0KS6sr9oL_Hn5i6WGlKdjQ9NZ8TqVtDmNlvdH-SPr3gkDP3EL4G0EzoB63R22Cr10eKobMezbvkmPbTKiF3BZkC3hUp0tIssvi9QuUa7Kq3A0AJD7xxD7-lLIH3A1KUyQ3WYKtJEPhUORtnMfdXTsWalUwX2eukq3iyERYoW4gProZ_4JZCoXJ2lh1I05eugM9zvZmZ3fLpJDz0Zo5KulHabaF0NSsYSrpNaIz8ReE1agaEFht45ht7Tl0AoW2_RaI0MryTulNE02KiKc6mHqs1Gn-I70TrW5sExpfW2Srcf99ymz_wSSF2CB1bagFG7vHfqO1mrgV54kx6q79J0MUg1cyTuR0GnU5-dFDunh16VVmBogaF3jqH39CUQZhKOjtrqwNdOVLKz9qWdCrnLOSXNnh0ERJmOPa_t0IT1zWUrVgmMHSRhAA8igDu3kaDz2PyD8AITZp8DRVGIh9oeZh1kj4smyQKnyIzIcYrE8zJHEmGAkQeL-sKwTxyr0BKvKKJCc5KokCz7xImKzEqcIEgsK3OkwD1JMs_JvMxzPJ2dAJKEWf9nsv4fA7Q-n5b8S6k9CbLCMzzDybIksvx58ee50hn5iec5nhFlhlF4VmJeH3XAkXgWmSdOkCVG4DlGpAUedygrWBPPjHAe8lWAXhvOc_wuBOdB4Dl-9gQjQ_yCu4H_Os7OAz3GbfcGWdXAwNn54xtJmAkCOHrD7-AMCjT97f8D).

To read the contacts as a table with distances and angles, [PLIP](/app/plip) takes the same file and lists every interaction. [Protein-ligand interactions](/guides/protein-ligand-interactions) explains what each contact type means.

## How to align and superimpose two structures

`align` makes a sequence alignment between two selections, fits the matched atoms, then runs refinement cycles that reject outliers. `super` fits by structure, so it still works when sequences differ, and `cealign` runs the CE algorithm with the target first and the mobile structure second. Load 1HVR beside 1HSG and fit one chain onto the other.
```text
fetch 1hvr
align 1hvr and chain A, 1hsg and chain A
super 1hvr and chain A, 1hsg and chain A
cealign 1hsg and chain A, 1hvr and chain A
```
Prefix selections with the object name, as above. Once two objects are loaded, `chain A` alone matches both. The log prints an RMSD for each fit. In the viewer, `align` follows PyMOL's method on the Cα atoms and prints the RMSD before and after refinement, while `super` and `cealign` both run TM-align, so `cealign` keeps PyMOL's argument order but not the CE algorithm.

On these two entries `align` prints `RMSD = 0.362 Å (93 to 93 atoms), after 2 refinement cycles. Before refinement: 0.420 Å over 99 atoms.`, and `super` and `cealign` both print 0.420 Å over 99 residues with a TM-score of 0.987. The same enzyme with two different inhibitors barely moves: refinement only drops the 6 least well fitting Cα atoms, which takes the RMSD from 0.42 to 0.36 Å.

![The PDB viewer with 1HSG in grey and 1HVR in orange as cartoons lying on top of each other, and the command line showing the super and cealign lines with RMSD 0.420 Å over 99 aligned residues and TM-score 0.987](/images/guides/pymol-commands/align-1hvr-1hsg.webp '**Figure 3. 1HVR fitted onto 1HSG.** The two HIV-1 protease structures overlap almost everywhere; the colouring came from `color gray80, 1hsg` and `color tv_orange, 1hvr` before the fits.')

[Open this view in the PDB viewer](https://proteiniq.io/app/pdb-viewer#session=7RrbcuI68le29GxzJNvyhap9IBAChFtCyGVSqZRsCyPwLbJMgKn8-5bsQDAzzMzZs3V2ajdPwe1Wu-_d6s5XwHxQB-GXRH24eoim1H_Y8pG78SfdIAAK8IkgoP4VCE5p-ZfE2SzhUQbqj19BSjiNBagD9Z88ScQ_VaB8oFAO6sDNWeirLK7J90CRJ4g8_PVNAZzOqkdXlGcsiUEdjK_mF95quBzrMNs-j_3zScpXDfCm_Mo3o0xNwzxgcc1PXuMwIf7hh0HOQ1AHcyHSrP7HH1Hi0zCrcS9zawkP_kDzLKi5HpsBBYTEpRJXwoACWHbGYsI3oC54TvcC9AeBc9m8H-m-cdciwWyGz87nVxVxtr31daNPOp1te9pc32kvBK4uX6vinCRzSriU8IyqJaeHas0EEYWxWHYxTzJxxO6y217Nzlpr_LJNLmdRs9dYpm6jwu5mKXSsp0N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7GgjQ2EkY6hozu2pGdgC0ED244GEdYdSx5GVk1HtmkZ0DAgxNgyFRXBGrRMC9sYIQdhjCQ93UYONKFhOZpt2pqmoKddZ5Fk9NDEP7s85NBk7kvYQ_nNa_cmZo7X7zWqDu7ebO2Xm0kzjS7u106DsJ6rnR0Z_ySZv3dBczqkPxc0nwuazwXN54Lmxwsa3Wm5zfmduEon8chsNzfRuc2r2dA8v9WN-f3I56r_sLjZDFILXRw1byfJ_F8vaDJLxR-Fx6KXbruTotFdv2km_m30fE4vqn3nfcIvbPWcOUJbscVtrzeYpdmRqk-S-VzQ_I8PRz4XNJ8Lms8FzeeC5vdf0GgDsx05X3qrTQrHGUtbg_CLXf1HP95Z2G7ny7Z1vxrxQdBZ-8mFeXTHOknmb1_QYB0iAxqm9lcWNI6G_uSCBlf3LaZlWPjf3rfk_fH4atAbao4-0S8e2qtb42JSbfVuz-Irx0xZpL5Gcdtq3HaT7eyvTnY-9y2_b0vxuW_5_fYtncn4brV67WcacpjdHAbT7YNWjdPA0Mf5NGxNW11nfbfUw2XIyBV4K6sliSgvpjtezsugLUfhUoeUF22AdHsFzJKVFM6ysS7rkK47lmHYuvKh6vojMmqWZlgIW9iydGQauqIZNd2Q40LHLiqhbSmOVsNY12zbgdiEumE8KSBPy61xESZCXkjFL9MzagaC0EGOhiwDmQ5-KpudPAN1Xa_JKaSBkIkMZBrG7lU5rbBquok1DRtQnsNSygDUES4TQ5vs-5eIxcMijaLid_FGOmYRP4X4E7EpurEyHYjSeO91pZ14-fsaxM954bHdeCA9HUP49i8).

`alignto 1hsg` fits every other open object onto 1HSG in one command and lists the RMSD and TM-score of each. For the numbers themselves, [RMSD](/guides/rmsd) explains what a fit does and does not tell you, and [superimpose protein structures](/guides/superimpose-protein-structures) compares the methods across programs.

### The ChimeraX version

ChimeraX's `matchmaker` also starts from a sequence alignment and then fits one atom per residue, the alpha carbon for protein. The viewer reads ChimeraX's form too.
```text
matchmaker all to 1hsg/A
```
`mm` is the short form. It fits every other model onto chain A of 1HSG. ChimeraX numbers models as `#1`, `#2`, and the viewer accepts those in specifications as well.

## How to colour by B-factor

The B-factor column records how much each atom's position smears in the crystal, and `spectrum b` turns it into a colour gradient. The command takes an expression, a palette and a selection, and `b` is one of the expressions it understands.
```text
spectrum b, blue_white_red, polymer
```
Blue is the lowest value in the selection and red the highest, and the log gives the range: `Colored by B-factor from 8.76 to 76.16.` The flaps that close over the inhibitor are not where the reds are in 1HSG. The two surface loops of chain A around residues 16 to 18 and 64 to 69 are, with Cα B-factors near 60 Å², while the core and the flaps stay blue.

![The PDB viewer with 1HSG as a cartoon coloured from blue through white to red by B-factor, mostly blue and grey with two red loops at the upper right, and the command line showing a short Python script that lists the highest B-factors](/images/guides/pymol-commands/b-factor.webp '**Figure 4. 1HSG coloured by B-factor.** Two surface loops of chain A, residues 16 to 18 and 64 to 69, are the reddest. The log shows the Cα atoms with the highest B-factors, listed with `cmd.iterate`.')

[Open this view in the PDB viewer](https://proteiniq.io/app/pdb-viewer#session=7VxZb9tKk_0rAz6X_fW-GJiH3Ow3q-MkzoLAoCXaYkKRCkl5u8h_H5xqWhadz_b1zBUwwMyDYIuiuruqazl1qqm_snKa7WTT04cHH48--z-EKcVZd_FMfXxc7WaUTfM-z3b-yvq2KNLfvO6OmnbeZTtf_8oWeVvUfbaTbf1n2zT9f25ldHVL0WY72eGyrKZbZb2NzzPCN3J8-a9flLXF0firJ0XblU2d7WRvd2dPJyevf7zVors4eDt9vLdoTx5kv-jvzDnvthbV8rist6fNaV01-XR94mzZVtlONuv7Rbfzr3_Nm2lRddvtpDvcbtrjf8lZd7x9OCmPMsqq_LDAvbiWUVZ2f5R13p5nO327LFYCvO5nT6oPu6_39_SXg3cv52Hv9f7L45E49mP54dnx_PvjSex9K5_MzcWz2e5YnBuHuUm4Rd52xVZa6bpauz7vebPK7ums6fpry33RejV_8vHT5z_V4p0_aU9fPzyZ7o6W253WL-277-1Z_eHPKnzYz19dfD-8pv0bh7lpuX2bfy8mfdOebx21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0Q1ljUlnDu-dTo44xnGCCHkmHwXOU5O9H80tWO3IqCr3fzrlccwQb9YYOrmA3ggOJwqYKVodRmueyOVUQmnDgiCt37k5K7k6m6lxwjeavn9G6Q3hwSIH41MyqqRw5IXIkwmzwQmZHZMok6pbjZ6BtgaE2oSFBwPMJ3Sf6i4nMYBIcAa0BugtkJqgutHERNFDxW5toLkQ70FuGyc17HVMmTyGhMe6ImYSdgYlRW647J4hCPpkBGGmud6q9Vcztjo9pK--x42O1fVt7UuTqyQw8N9s21drTIuXk-eP37z6dNwePfuwfPPtzMf3z8cX4GdTp8y-PP7x9_sfs84vZ4-bx0w--Xb7-n_7qQPoxBjwphucCrz8O-b_vWUf1f-hZR_H_zzr-7WcdsdMP13AsHjBL2z_JEbPUpaNd_q5Gzj8vMU9uM2naumiz8Y_RPCun06K-9ms0p8Ys3l70-7vP5q_E-cPP84P8jRw_1fXx9Of3F6cfZgeT3O_9_HO3PX-_Gx5kv9JjfPm8aPlnJybLNjlt-pkW6LBo-flEmD1lR80JhPPBajwgp3X0BhTLlaqBvLaFlM45L7WLFo19ZbdFkEEbZ6OLCifjo9pWTjodowohBAeYuFywm0h2kx5Pyvd_ezyzLbXSVhttovRy6DFPy2WX7Wi97ZV10gfjdYzI6cNn6Sck5La2wUtrtHTCgq3PjppjZJ0UG57kq2cr52X9miOp5P_5E9gmuxBrYK8_5ydFU0To0_4Nz7w9aSbL4Vd6psuWjfZ5_apLkOfXfwE).

The same colouring in ChimeraX reads attributes instead:
```text
color byattribute bfactor /A palette rainbow range 10,60
```
ChimeraX also has `color bfactor`, and its range option fixes the ends of the scale. The viewer runs the `byattribute` form shown above.

## How to save an image with png and ray

`png filename, width, height, dpi` writes the current view. Sizes are pixels unless they carry `cm`, `mm` or `in`, and a unit needs a dpi.
```text
ray
png 1hsg.png, 10cm, dpi=300
```
In PyMOL, `ray` ray-traces the current frame, and `png` can do it for you with `ray=1`.

The viewer does it differently. `ray` switches on ray-traced lighting for the canvas and for every image saved afterwards, and the `ray=1` option is accepted but changes nothing, because every image is already rendered off screen. The file name loses any folder, so `png ~/Desktop/a.png` saves `a.png` where the browser puts downloads.

[How to make a publication-quality protein figure](/guides/protein-figures) covers backgrounds, lighting and sizes for journals.

## How to run a PyMOL script

A PyMOL script is a plain text file of commands, one per line, saved with the extension `.pml`. PyMOL runs it with `@script.pml` or **File**, then **Run script**. The viewer has no `@`: drop the `.pml` file on the canvas, or paste its lines into the command line, and it runs them in order and lists any that failed.
```text
fetch 1hsg
hide everything
show cartoon
color gray80, polymer
select site, resn MK1
select pocket, byres (polymer within 4 of site)
show sticks, site or pocket
distance hb, site, pocket, mode=2
zoom site, 8
png 1hsg_pocket.png, 1600
```
For loops and conditions, a short Python script works in the same place. Paste it into the command line, drop a `.py` file, or put it between `python` and `python end` in a `.pml` file.
```python
stored.res = []
cmd.iterate("chain A and name CA", "stored.res.append((resi, resn))")
for resi, resn in stored.res:
    if resn in ("ASP", "GLU"):
        cmd.color("red", f"chain A and resi {resi}")
print(len(stored.res), "residues")
```
This colours every aspartate and glutamate in chain A red and prints how many residues the chain has. With only 1HSG open it prints `99 residues` and colours 8 of them, Glu21, Asp25, Asp29, Asp30, Glu34, Glu35, Asp60 and Glu65. If 1HVR from the alignment section is still open, `chain A` matches both objects and the count is 198. The viewer runs its own Python interpreter inside the page, so it covers loops, functions, f-strings and `math`, and stops a run after 15 seconds. It has no classes, `with` blocks or NumPy. [PyMOL file types](/guides/pymol-file-types) lists what `.pml`, `.py` and `.pse` files hold and how to open each without PyMOL.

## Movies, mutations and electrostatics

Three tasks that PyMOL users search for work through different commands in the viewer.

PyMOL builds a movie with `mset`, `mview` and `mplay`. The viewer accepts the same verbs and keyframes whole scenes.
```text
scene 001, store
mset 1 x120
mview store, 1, scene=001
mplay
movie mp4, talk.mp4, 1920, 1080
```
PyMOL's mutagenesis is a wizard in the Wizard menu, with no command form to type. The viewer has its own command instead, `mutate A/82 PHE`, which swaps valine 82 of chain A for phenylalanine, draws the side chain that clashes least and lists the rotamers in the side panel.

PyMOL's APBS support is a plugin that needs the `apbs` and `pdb2pqr` programs installed. The viewer has its own `electrostatics coulombic` command, which colours the surface by a Coulombic estimate in the browser, and [PDB2PQR](/app/pdb2pqr) prepares a structure for APBS if you want to run it yourself.

## Commands that do not run in the viewer

The viewer answers `not supported yet: <command>` for PyMOL commands it has no equivalent for, and for any first word it does not know. `wizard` and `pseudoatom` are two. `set` works only for the settings that `help set` lists, and `run file.pml` explains that the file has to be dropped on the canvas instead. A line that is valid Python, such as `x = 5`, runs as Python rather than being rejected.

Named selections last until you reload the page, and share links do not carry them. A scene made only of files from your own computer cannot be shared by link at all.

## Common mistakes

  <caption><strong>Table 2. Command mistakes that look fine until the result is wrong.</strong> Sources: PyMOL Wiki (2026), PDB viewer behaviour.</caption>
  <thead>
    <tr>
      <th scope="col">Problem</th>
      <th scope="col">Symptom</th>
      <th scope="col">Fix</th>
    </tr>
  </thead>
  <tbody>
    <tr><td><code>cealign</code> arguments in the <code>align</code> order</td><td>The reference structure moves instead of the model</td><td>Write <code>cealign target, mobile</code>; <code>align</code> and <code>super</code> take mobile first</td></tr>
    <tr><td><code>chain A</code> with two objects loaded</td><td>A colour or fit hits both structures</td><td>Start the selection with the object name, as in <code>1hsg and chain A</code></td></tr>
    <tr><td>A <code>set</code> name the viewer does not map</td><td>The log says <code>not supported yet: set name</code></td><td>Run <code>help set</code> for the settings it accepts</td></tr>
    <tr><td>Expecting <code>ray</code> to save an image</td><td>Nothing is downloaded after <code>ray</code></td><td>Follow it with <code>png name.png, 2400</code></td></tr>
    <tr><td>Reloading the page</td><td>Named selections such as <code>site</code> are gone</td><td>Run the <code>select</code> lines again, or save a session file under <strong>Export</strong></td></tr>
    <tr><td><code>@script.pml</code> in the command line</td><td><code>not supported yet</code></td><td>Drop the file on the canvas or paste its lines</td></tr>
  </tbody>

## After the commands

A figure usually leads to the next question: whether the structure deserves trust, or how a docked pose compares with it. [Open a PDB file](/guides/open-pdb-file) covers getting your own structures into the viewer, [PyMOL licence and download options](/guides/pymol-license) covers installing PyMOL itself, and [Ramachandran plot](/guides/ramachandran-plot) checks the backbone.

## FAQ

### What are the most useful PyMOL commands?

`fetch` to load an entry, `show` and `hide` for representations, `color` and `spectrum` for colour, `select` for named selections, `distance` for contacts, `align` or `super` to superimpose, and `png` to save an image. Table 1 lists each with an example.

### Can I run PyMOL commands without installing PyMOL?

Yes, for the commands in this guide. The [PDB viewer](/app/pdb-viewer) runs them in your browser tab, and anything it does not recognise is reported as `not supported yet`.

### How do I show polar contacts in PyMOL?

Use `distance name, selection1, selection2, mode=2`. It draws dashes between donor and acceptor atoms of the two selections that are close enough to hydrogen bond.

### What is the difference between align, super and cealign?

`align` starts from a sequence alignment, so it suits close homologs. `super` and `cealign` compare structure and work when the sequences differ, and `cealign` takes the target first.

### Are there ChimeraX equivalents?

For several, yes. `matchmaker`, `color byattribute` and `clip` run in the viewer in their ChimeraX forms, as do `clashes` and `contacts`.
