Skip to content

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 17 Oct 17:38
· 36 commits to main since this release
97f7dbf

Highlights

  • Heatmaps, 2-D histograms and meshes take render=ub.Render.VECTOR, ub.Render.RASTER or ub.AUTO (the default). With AUTO, grids of at least 10,000 cells (100 × 100) are drawn as one image with one pixel per cell; smaller grids stay vector shapes.
  • In SVG the image is scaled without smoothing, so cells stay sharp at any zoom in browsers, librsvg, resvg, cairosvg and Inkscape; labels, axes, annotations and colorbars stay vector. In PNG each pixel takes the exact area-weighted average of the cells it covers.
  • A 1,000 × 1,000 heatmap's SVG drops from 94 MB to 4.5 MB and renders in about 0.2 s; its PNG renders in about 0.15 s instead of 0.9 s.

Changes to existing figures

  • Heatmaps, 2-D histograms and evenly spaced meshes with at least 10,000 cells are now drawn as an image by default. Pass render=ub.Render.VECTOR to keep one shape per cell, for example to edit cells in a vector editor. Smaller grids are unchanged.

New errors

  • render=ub.Render.RASTER on a mesh whose edges are not evenly spaced raises UsageError at the mesh() call. It raises StyleError when rendering if the limits would move an edge by more than 0.001 pt or a cut cell would reach more than 10,000 pt past them. ub.AUTO draws such meshes as vector shapes instead.

What's Changed

Full Changelog: v0.3.0...v0.3.1