# Crystal Plot

> Render a publication-quality 4-view crystal-structure figure (view ‖ a, view ‖ b, view ‖ c, perspective) as a single PNG. Use when the user asks to plot, draw, render, or visualize a crystal structure, atomic structure, or unit cell, or when they supply a structure file (CIF, POSCAR, .vasp, .xyz, .traj) or name a preset like 'mx2:MoS2', 'bulk:Si', 'graphene'. Korean triggers include 결정구조 플롯, 원자구조 그려, 구조 그림, 단위격자 plot, VESTA-like figure.

- Skill: `sogang-qmp/crystal-plot` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add sogang-qmp/crystal-plot`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sogang-qmp/crystal-plot/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: sogang-qmp (https://skillmd.com/u/sogang-qmp)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/sogang-qmp/crystal-plot

---


# crystal-plot

Render a 4-panel crystal-structure figure from one input. Output is a PNG calibrated to the conventions used in Nature / PRX / Sci. Adv. structure figures.

## Quick start

```bash
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" <input> -o out.png
```

`<input>` is one of:

- a structure file path: anything `ase.io.read` accepts (`.cif`, `POSCAR`, `.vasp`, `.xyz`, `.traj`)
- a preset: `mx2:MoS2`, `mx2:WSe2:1T`, `bulk:Si`, `bulk:NaCl:rocksalt:5.64`, `graphene`

The script writes the output path to stdout. Errors go to stderr and exit non-zero. Missing dependency exits with code 2; install with `pip install --user ase`.

## Defaults

- supercell repeat: `3,3,1` if the cell has vacuum (> 6 Å along any axis), else `2,2,2`
- perspective: `α = -55°, β = 210°` so a → down-left, b → down-right, c → up
- bond cutoff: `1.15 × Σ(covalent radii)`
- atom radius: `0.40 × covalent_radius`
- cell box: dashed blue, perspective panel only

The defaults are calibrated; do not retune unless the user asks. See [references/CONVENTIONS.md](references/CONVENTIONS.md) for the full rendering spec (palette, Phong shading, rotation matrix, depth scaling, tripod placement, bond-cutoff refinements for metals).

## Options

```text
-o, --out FILE          output PNG (default: <stem>.png in cwd)
--repeat NX,NY,NZ       supercell repeat (overrides auto-default)
--perspective AX,AZ     tilt + azimuth in degrees (default: -55,210)
--bond-scale 1.15       bond cutoff = scale × Σr_cov
--radius-scale 0.40     atom radius = covalent_radius × scale
--no-cell-box           omit the dashed cell box on the perspective panel
--dpi 240
--figsize 11,8
```

## Examples

```bash
# 1H-MoS2 monolayer
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" mx2:MoS2 -o mos2.png

# Diamond Si, primitive 1×1×1 cell, no cell box
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" \
    bulk:Si --repeat 1,1,1 --no-cell-box -o si.png

# Read a relaxed POSCAR with a custom tilt
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" \
    POSCAR --perspective -45,210 -o relaxed.png

# CIF from Materials Project
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" mp-2815.cif -o WSe2.png
```

## Out of scope

- Interactive 3D viewer — use `ase gui` or VESTA.
- Polyhedral rendering (perovskite octahedra, ZIF tetrahedra). Ball-and-stick only.
- Charge density / orbital isosurfaces. Use VESTA + a `.cube` file.

