Skip to content

0.1.1b2: one type scale, measured layout, truecolor PDF rasters - #1

Merged
RunpengLuo merged 2 commits into
mainfrom
dev
Oct 18, 2026
Merged

RunpengLuo merged 2 commits into
mainfrom
dev

Conversation

@RunpengLuo

Copy link
Copy Markdown
Collaborator

Summary

  • Fonts configured in one module, cnplot_style (family, embedding types, FS_* sizes, apply_style()), applied to rcParams on import.
  • Layout measured instead of assumed: CN key wraps onto further rows, strip legends stack by rendered height, heatmap colorbar grows until its ticks clear, heatmap title anchored above the mesh.
  • Genome-axis labels clear each other: chromosome names keep their rotation (60 degrees by default) and are nudged apart or split onto a second row; crowded Mb labels are blanked; the gap above a profile is sized in inches.
  • Figures draw on the pdf and svg backends as well as Agg.
  • PDF rasters are written as 8-bit DeviceRGB instead of /Indexed palette images, working around matplotlib#27893.
  • Clone labels, heatmap row-block labels and the CN key title are regular weight.
  • FigureSaver.close() is idempotent; plot_strip_legend loses entry_h.
  • Version 0.1.1b2.

Note

Importing cnplot now sets global font sizes, so figures drawn by downstream code without explicit sizes change too.

See CHANGELOG.md for details.

- Fonts are configured in one module, cnplot_style: family, embedding
  types, FS_* sizes, and apply_style(), which writes them into rcParams
  on import.
- Layout is measured instead of assumed: the CN key wraps onto further
  rows, strip legends stack by rendered height, the heatmap colorbar
  grows until its tick labels clear, and the heatmap title is anchored
  above the mesh.
- Genome-axis labels are placed to clear each other: crowded chromosome
  names stand upright and are nudged apart or go on a second row, Mb
  labels too close to the previous one are left blank, and the gap above
  a profile is sized in inches from the labels it holds.
- Text is measured without an explicit renderer, so the figures draw on
  the pdf and svg backends as well as Agg.
- The PDF backend no longer stores rasterized layers as /Indexed palette
  images; the hook is locked and warns once if matplotlib stops routing
  images through it. Works around matplotlib#27893.
- FigureSaver.close() can be called twice.
- plot_strip_legend loses its entry_h argument.
- Version 0.1.1b1.
…ls; 0.1.1b2

- Chromosome names keep the requested rotation (60 degrees by default)
  instead of standing upright when crowded; crowded names are still
  nudged apart, or split onto a second row on a narrow axes.
  chrname_tiers takes a rotation argument and genome_label_room sizes the
  gap for names at that angle.
- Clone labels beside the integer-CN profile, the heatmap row-block
  labels and the CN key's CNA title are set in the regular weight.
- Gallery images redrawn.
- Version 0.1.1b2.
@RunpengLuo
RunpengLuo merged commit cc5bbd7 into main Oct 18, 2026
8 checks passed
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