Skip to content

Fix:theme_blank plot margin#15

Merged
hurry060215-tech merged 7 commits into
mengxu98:mainfrom
hurry060215-tech:codex/theme-blank-margin
Jun 8, 2026
Merged

Fix:theme_blank plot margin#15
hurry060215-tech merged 7 commits into
mengxu98:mainfrom
hurry060215-tech:codex/theme-blank-margin

Conversation

@hurry060215-tech

@hurry060215-tech hurry060215-tech commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Increase the default theme_blank() plot margin from lab_size + 2 to lab_size + 10 on all sides.
  • Reposition coordinate axis labels away from the origin: the x label sits just beyond the x-axis arrow, and the y label sits just beyond the y-axis arrow.
  • Add a small testthat check that locks the default margin for coordinate annotations.

Why

theme_blank() draws coordinate arrows and axis labels outside the panel with coord_cartesian(clip = off). The previous default margin was too small for plots such as CellDimPlot(..., theme_use = theme_blank), so the coordinate annotation could be clipped at the canvas edge. The labels were also anchored at the coordinate origin, which made them visually touch the axes.

Validation

  • Ran git diff --check successfully.
  • Ran devtools::test(stop_on_failure = TRUE) successfully: PASS 1 / FAIL 0.
  • Rendered a local preview with longer labels (Standardpca_1, Standardpca_2) to visually check the annotation placement.

@hurry060215-tech hurry060215-tech changed the title [codex] Fix theme_blank plot margin Fix:theme_blank plot margin Jun 8, 2026
@hurry060215-tech hurry060215-tech marked this pull request as ready for review June 8, 2026 12:20
@hurry060215-tech hurry060215-tech force-pushed the codex/theme-blank-margin branch from f3d0c9d to f48e192 Compare June 8, 2026 12:37
@hurry060215-tech hurry060215-tech merged commit 6a27f6c into mengxu98:main Jun 8, 2026
6 checks passed
@hurry060215-tech hurry060215-tech deleted the codex/theme-blank-margin branch June 8, 2026 13:59
@hurry060215-tech hurry060215-tech restored the codex/theme-blank-margin branch June 8, 2026 14:00
@hurry060215-tech

Copy link
Copy Markdown
Collaborator Author

已重新整理 \ heme_blank()\ 的画布和坐标标注布局,最新提交 \6317e85\ 已推送到 PR 分支。主要调整:plot margin 提高到 \lab_size + 10\;x 轴标注放到 x 轴箭头右下侧;y 轴标注放到 y 轴箭头左上侧,避免原点附近重叠和裁剪。已跑 \devtools::test(stop_on_failure=TRUE)\,结果 PASS 1 / FAIL 0。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant