Repository navigation
v0.3.1
Highlights
- Heatmaps, 2-D histograms and meshes take
render=ub.Render.VECTOR,ub.Render.RASTERorub.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.VECTORto keep one shape per cell, for example to edit cells in a vector editor. Smaller grids are unchanged.
New errors
render=ub.Render.RASTERon a mesh whose edges are not evenly spaced raisesUsageErrorat themesh()call. It raisesStyleErrorwhen 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.AUTOdraws such meshes as vector shapes instead.
What's Changed
- Draw large cell grids as one image by @TJ-Junhao in #136
- Version 0.3.1 by @TJ-Junhao in #137
Full Changelog: v0.3.0...v0.3.1