LayMesh文档
EN

Colorbars

colorbars.lay
# Each heatmap owns one colorbar. Four positions are edited independently.# Every data rectangle is 52 x 36 mm; changing colorbar length never resizes it.page = canvas(size=(220 mm, 204 mm), background="#ffffff")style = plot_style(font_family="DejaVu Sans", font_size=8 pt)z = [[0, 1000, 2000, 3000], [1000, 2000, 3000, 4000], [2000, 3000, 4000, 5000]]value = text(spans=[formula(source=r"I", font_size=8 pt), span(" (a.u.)")],             font_family="DejaVu Sans", font_size=8 pt) right_chart = plot(size=(96 mm, 82 mm), plot_area=box(offset=(22 mm, 25 mm), size=(52 mm, 36 mm)), style=style,             x=axis(label="x", ticks=[0, 2, 4]), y=axis(label="y", ticks=[0, 1, 2, 3]))hr = right_chart.heatmap(z=z, vmin=0, vmax=5000)right_chart.colorbar(hr, position= right, ticks=[0, 2500, 5000], notation= offset, format=".1f", label=value)a = page.add(right_chart, anchor= plot_top_left, offset=(28 mm, 36 mm))page.add(text(content="(a) Right / full height", font_family="DejaVu Sans", font_size=10 pt),

预览

背景
Colorbars
原始示例
合计 —
详情

尚未运行

本设备浏览器实测;不含防抖等待。

修改仅保留在本页
依赖文件
  • examples/plot/colorbars.lay

复现

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