LayMeshDocs
中文

Scientific Labels

scientific-labels.lay
# Two independently placed 76 x 52 mm data rectangles.# Label and exponent offsets are independent chart-local physical lengths (right/down).# The short x title shares the multiplier row; only default collisions add a title row.page = canvas(size=(220 mm, 115 mm), background="#ffffff")style = plot_style(font_family="DejaVu Sans", font_size=8 pt, colors=["#264b69"])q_label = text(spans=[formula(source=r"q", font_size=9 pt), span(" ("),                      formula(source=r"\mathrm{nm}^{-1}", font_size=9 pt), span(")")],               font_family="DejaVu Sans", font_size=9 pt)left = plot(size=(110 mm, 98 mm), plot_area=box(offset=(24 mm, 22 mm), size=(76 mm, 52 mm)), frame= box, style=style,            x=axis(label=q_label, range=(-0.002, 0.002), ticks=[-0.002, 0, 0.002],                   notation= scientific, format=".1e", tick_direction= in),            y=axis(label=formula(source=r"I-I_0", font_size=10 pt), range=(-1000000, 1000000),                   ticks=[-1000000, 0, 1000000], notation= offset, format=".1f", tick_direction= in))left.hline(y=0, color="#bbbbbb", line_width=0.4 pt)

Preview

Background
Scientific Labels
Original example
Total —
Details

Not run yet

Measured in this browser; excludes debounce.

Edits stay on this page
Dependencies
  • examples/plot/scientific-labels.lay

Reproduce

sh
laymesh validate examples/plot/scientific-labels.laylaymesh render examples/plot/scientific-labels.lay -o figure.svglaymesh render examples/plot/scientific-labels.lay -o figure.pdflaymesh render examples/plot/scientific-labels.lay -o figure.png --dpi 300