科研 Skill
物理海洋学论文绘图
oceanography-plotting-style
绘制物理海洋学论文图:区域/全球/极地地图、多面板、垂向剖面、Hovmöller图、cmocean配色与期刊版式。投稿级海洋学图件排版和配色时使用。
SKILL.md
物理海洋学论文绘图
目标
产出一张能直接放进论文的图:数据形状正确、地图要素完整、色标含义明确、字号在最终印刷宽度下可读、输出可复现。默认使用 Matplotlib + Cartopy + cmocean;最终脚本不允许留下 ...、TODO 或未定义的变量。
设计立场
本 skill 的视觉语言服务于作者的个人绘图偏好,不是期刊官方模板:
- 只用 cmocean,不用 jet/rainbow;色标由变量属性决定。
- 图优先、文字克制:不设整张图的主标题,只用子图副标题和
(a)/(b)面板字母;能共享的横纵坐标就共享。 - colorbar 清晰但不占主图:优先外置列、图下横条或 inset;刻度 4–7 个,
extend必须诚实。 - 分析图同源:CCA、小波、谱分析、EMD 也使用同一套克制、可验证的语言。
这只是作者的选择,不评判其他作者;投稿前仍须核对期刊最新指南。完整说明见 docs/style-philosophy.md。
先确认(只问会改变图的)
按影响从大到小确认;用户没给就采用括号内默认值,并在最终回复中写明假设:
- 最终尺寸/期刊:单栏、1.5 栏还是双栏?(默认双栏 7.2 in 宽,最终以期刊 preset 为准)
- 区域与投影:经纬度范围、是否跨日界线、是否需要保角/等面积?(区域中低纬默认 Mercator;全球 Robinson;极地 PolarStereo;数据 transform 仍用 PlateCarree)
- 变量与单位:变量名、单位、正负号约定、是否异常值/距平?(默认按数据 1–99% 分位定范围)
- 时间处理:单帧、时间平均、时间序列还是 Hovmöller?(默认保留时间维,不擅自取
time=0) - 输出:PNG 300 dpi、600 dpi,还是 PDF/SVG 矢量?(默认 PNG 300 dpi + 同名 PDF)
能从数据判断的先判断;不要一次问十个问题。
工作流
- 检查数据:维度顺序、坐标名、单位、范围、NaN/陆地掩膜、经度约定、纬度升降序、时间 calendar。先用
inspect_dataset()或ocean-plot --inspect查变量/坐标候选,不靠猜。 - 规范化:统一为
time, depth, lat, lon;经度按图件约定处理并排序;用validate_grid验证形状。优先用ocean_data,细节见 data-prep 和 netcdf-profiles。 - 选图型:先查 figure-catalog,再按领域读 recipes;不要先扫所有 reference 文件。
- 搭
main():参数块放在开头;期刊宽度、字号从ocean_journal取;先set_ocean_style,再apply_journal_style,避免线宽被覆盖。 - 绘图:优先复用
ocean_plot的刻度、字体、色标、校验函数;模板从templates/复制后再改。 - 验证:运行
check_figure(fig, check_bounds=True),并实际打开渲染后的 PNG;不能只看代码。 - 交付:保存 PNG 和 PDF,报告路径、实际范围/色标、以及所有假设。
硬规则
- 参数集中:
output_path、区域、色标名、vmin/vmax、extend、字号、figsize、dpi、面板标签放在main()开头。 - 按最终物理尺寸设计:不要先画 22×24 in 再缩字号。双栏通常 7.0–7.5 in 宽;正文/刻度约 6–10 pt,具体以期刊 preset 为准,Nature 等例外必须核对指南。
- 字体先验证:
Arial不存在时自动回退并警告;中文标签需要 CJK 字体;设置axes.unicode_minus=False,PDF 使用pdf.fonttype=42。 - 地图显式坐标变换:
transform=ccrs.PlateCarree();set_extent、经纬度 formatter、海岸线/陆地、刻度方向成套出现。非矩形投影不能用 Cartopy 的经纬度 formatter,改用gridlines(draw_labels=True)。 - 地图比例:默认
ax.set_aspect("equal");只有版面确实需要时才用"auto",并在图注或回复中说明。 - 网格绘制:
pcolormesh显式使用shading="auto";中心坐标不要当边界坐标;大网格加rasterized=True。 - 色标诚实:
extend表示数据真的超出色标范围,不是变量正负。对称距平用balance+ 对称vmin/vmax;有界数据用"neither";p99 截断才用"max"/"both"。 - 色标可读:必须有变量名和单位;刻度 4–7 个;同变量、同范围的多面板共用一条色标。
- 时间轴:优先
auto_time_axis;跨年不用%m-%d,跨月不用单一%Y。 - 人类教程默认忽略:
docs/tutorials/只用于教学/讲解;普通绘图任务不要读取或据此扩大范围。 - 不要原地改数据:滤波、掩膜、裁剪默认返回副本;IQR 在
IQR=0时跳过。 - 先验证再画:1D 坐标 + 2D 数据、2D 坐标 + 2D 数据、
data.shape[-2:]必须与经纬度对齐;跨 0°/360° 要处理。 - 成图检查:面板字母在坐标区左上外侧;检查标签裁切、色标三角、刻度重叠、字形缺失;
save_figure设tight=False才能保持figsize的最终宽度。
API 顺序
| 步骤 | 调用 |
|---|---|
| 读取/规范化 | inspect_dataset → resolve_variable → load_for_plot → grid_arrays → validate_grid |
| 样式 | set_ocean_style → apply_journal_style(顺序不能反) |
| 投影 | projection_for_region(..., kind="auto");数据 transform 用 PlateCarree;set_map_ticks 自动选 formatter/gridlines |
| 地图 | add_map_features;非矩形投影用 set_map_ticks 的 gridlines 模式 |
| 色标 | get_cmap("cmo.dense") → colorbar_ticks → add_colorbar |
| 布局 QA | check_figure(fig, check_bounds=True) |
| 保存 | save_figure(fig, path, dpi=300, also_pdf=True, tight=False) |
常用预设:get_journal("agu"|"ams"|"elsevier"|"nature"|"generic")。这些数值是经验值,必须核对最新 author guidelines。
出图前检查表
- 坐标与数据形状匹配;没有把
(lat,)和(lon,)广播成错误矩阵。 - 经度约定统一;跨日界线/0° 没有断裂;纬度升降序已处理。
- 地图范围、投影、刻度、海岸线、陆地正确;比例没有被拉扁。
- 色标有标签/单位;
vmin/vmax与数据范围相符;extend与截断一致。 - 多面板同变量共用色标;不同变量没有误共用。
- 字号按最终宽度可读;没有缺字/方框;负号正常。
- 面板字母在左上外侧;标题、轴标签、图例没有被裁切。
- 时间轴刻度不重叠;跨年/跨月格式正确。
- 输出文件存在且非空;PNG 已实际打开检查;PDF 字体已嵌入。
- 最终回复写明输出路径、色标范围、数据假设和未解决项。
资源
- style-reference:字体、版面、地图、色标、验收与失败案例。
- data-prep:xarray 维度、区域裁剪、经度/纬度、滤波与形状校验。
- netcdf-profiles:CF、产品命名、
inspect_dataset()与歧义处理。 - figure-catalog:先选图型,再进入对应领域 recipe。
- recipes:按地图/剖面/时间序列/统计/谱/流场拆分的配方。
- ocean_plot.py:投影、刻度、地图、色标、布局检查、保存;
--self-test自检。 - ocean_vocab.py:变量/坐标别名、CF、产品 profile、数据集诊断。
- ocean_data.py:维度统一、区域裁剪、跨日界线、
grid_arrays()。 - ocean_spectral.py:FFT 振幅谱与 AR(1) 红噪声阈值。
- ocean_journal.py:期刊栏宽与字号预设。
- ocean_access.py:灰度与近似 CVD 筛查。
- templates/:两个可运行的合成数据模板,必须加
--demo。 - docs/style-philosophy.md:完整设计立场。
- docs/tutorials/README.md:人类教程;普通绘图任务默认忽略,只有用户明确要求教学/讲解时才读。
模板中的合成数据仅用于演示版式,交付前必须替换为真实数据。仓库开发验收:python -m pytest -q 与 python scripts/ocean_plot.py --self-test。
示例提示词
帮我按期刊版式画一张带cmocean配色的Hovmöller图和垂向剖面图。
所属插件
安装该插件会一并获得同领域的 18 个 Skill / MCP。
同插件的其他科研 Skill
- OpenAQ空气质量分析Accesses OpenAQ air quality data (PM2.5, O3, NO2), runs spatial interpolation, health exposure indices, city comparisons. Use for air pollution monitoring and exposure analysis.
- Copernicus气候数据下载Downloads climate/weather data from the Copernicus Climate Data Store (ERA5, seasonal forecasts) via cdsapi, covering API setup and request splitting. Use for any CDS/ECMWF download.
- 气候趋势检验分析Runs climate trend analysis: Mann-Kendall test, Sen’s slope, extreme indices (RX1day, R10mm), percentile thresholds, IPCC-style figures. Use to detect and visualize climate trends.
- 生态多样性群落分析Computes community-ecology diversity metrics and ordination: Shannon/Simpson indices, rarefaction, NMDS/PCoA, PERMANOVA. Use when analyzing species-by-site community composition data.
- ERA5再分析气候数据Downloads and analyzes ERA5 reanalysis data via the Copernicus CDS API: anomalies, trends, publication-quality climate maps. Use for ERA5-specific climate analysis end to end.
- GBIF物种分布建模Queries GBIF occurrence records, applies spatial thinning, and fits species distribution models (MaxEnt, BRT) with pygbif/geopandas/elapid. Use for occurrence and habitat-suitability analysis.
- 综合地理空间科学分析Covers broad geospatial workflows: satellite imagery, vector/raster GIS, spatial ML, point clouds, cloud-native formats (STAC, COG). Use as a general entry point for remote sensing or GIS tasks.
- GeoPandas矢量GIS分析Performs vector GIS analysis with GeoPandas: spatial joins, overlays, buffer/dissolve, choropleth maps, rasterio integration. Use for vector spatial analysis and raster-vector workflows.
- DEM水文地貌分析Runs DEM-based hydrological analysis with pysheds: watershed delineation, flow direction/accumulation, stream networks, runoff estimation. Use for terrain-driven hydrology modeling.
- 海洋碳酸盐化学Computes seawater carbonate chemistry with PyCO2SYS: pH, pCO2, aragonite/calcite saturation, air-sea CO2 flux. Use for ocean carbon-cycle and acidification analysis.
- MetPy大气探空分析Performs atmospheric analysis with MetPy/Siphon: downloads NWP data, plots skew-T log-P diagrams, computes CAPE/CIN, builds synoptic composites. Use for weather-sounding meteorology analysis.
- 地震波形数据处理Analyzes seismological data with ObsPy: waveform download, filtering, P/S phase picking, moment magnitude, spectral analysis. Use for earthquake and seismic-waveform analysis.
- 海洋再分析数据分析Downloads and analyzes oceanographic data from Copernicus Marine Service and Argo floats with gsw/xarray: mixed layer depth, eddy kinetic energy, T-S diagrams. Use for physical oceanography.
- 种群动态建模Models population dynamics with logistic/exponential growth, Lotka-Volterra, matrix population models, mark-recapture abundance estimation. Use for quantitative population ecology.
- QGIS自动化地理处理Drives QGIS (PyQGIS, processing, GDAL) for GIS/remote sensing tasks: raster/vector ops, spectral indices, reprojection, zonal statistics, map layouts. Use for any QGIS-based geospatial task.
- 多光谱遥感影像处理Reads, reprojects, and analyzes multispectral GeoTIFF imagery with rioxarray/rasterio: NDVI/EVI, cloud masking, mosaicking, Cloud-Optimized GeoTIFF export. Use for raster remote-sensing processing.
- Google Earth Engine卫星分析Runs Google Earth Engine satellite analysis with geemap/ee: NDVI time series, land-cover classification, change detection, GeoTIFF export. Use for cloud-based large-scale satellite analysis.
常见问题
物理海洋学论文绘图能做什么?
绘制物理海洋学论文图:区域/全球/极地地图、多面板、垂向剖面、Hovmöller图、cmocean配色与期刊版式。投稿级海洋学图件排版和配色时使用。
如何安装物理海洋学论文绘图?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「物理海洋学论文绘图」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
物理海洋学论文绘图需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
物理海洋学论文绘图经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。