pypi fastplotlib 0.7.0
v0.7.0

5 hours ago

This is a big release with a ton of new features!

New

  • NDWidget: The biggest new addition, a system for viewing n-dimensional multi-modal datasets with arbitrary graphical representations. For more information see docs on the data model and a guide on how to use it. While this does talk about neuroscience datasets, it is applicable to any forms of scientific data that fit the data model (n-dim, multi modal, heterogeneous sampling, etc.). Big thanks to everyone who was involved in designing, brainstorming and reviewing the NDWidget! @clewis7 @apasarkar @FlynnOConnell
  • New graphics: MeshGraphic, SurfaceGraphic, PolygonGraphic, InfLineGraphic, and ImageYUVGraphic (YUV components sent straight to the GPU, much faster for displaying video data, use with asyncvideo: https://pypi.org/project/asyncvideo/).
  • Collections refactor: new ScatterCollection, ScatterStack, ImageCollection and ImageGrid. Numpy-like fancy indexing across graphics.
  • Lines and scatters: dash_pattern and thin args, and cmap_range
  • Images: native dtypes are kept (only 64-bit types are cast to float32), new args: gamma, colorspace, cpu_buffer and texture_usage.
  • Data setters: setting data with a different size or shape automaticlaly allocates a new buffer!
  • Graphic: scale, map_model_to_world()/map_world_to_model(), tooltip_format.
  • Selectors: the HighlightSelectors, VisibilitySelector, ImageVisibilitySelector, SelectorCollection (LinearSelectors, RectangleSelectors, …) and SelectionVector.
  • Tools: a Cursor tool and a tooltips.
  • imgui: windows can go on any edge, float, or sit in the toolbar, for a figure or a single subplot (add_imgui_window). Each graphic can have its own right-click popup. ImguiColorbar replaces the HistogramLUTTool.
  • Config system, see the docs.
  • Other: Figure(rects=/extents=) accepts a dict keyed by subplot name; axis labels; PlotArea.x_range/y_range/map_world_to_screen(); matplotlib migration guide.

Breaking

  • Dependencies: Python ≥ 3.11, numpy ≥ 2.1, pygfx == 0.17.0. imgui requires imgui-bundle<1.92.900 until the next wgpu-py release.
  • isolated_buffer removed from every graphic; buffers always copy, some graphics such as ImageGraphic, have a cpu_buffer that you can set to false for directly sending data to the GPU with no copy.
  • All uniform_* kwargs removed: uniform_color(s), uniform_marker, uniform_edge_color, uniform_size and point_rotation_mode are gone, and the mode is inferred from the passed or set value. A single color is now uniform, so line.colors returns a pygfx.Color and line.colors[i] = ... raises TypeError unless per-vertex colors were passed.
  • Line/scatter cmap: returns a cmap.Colormap and is applied on the GPU. Use cmap_transform/cmap_range instead of graphic.cmap.transform.
  • Image cmap: returns a cmap.Colormap instead of a str.
  • Collections: collection[i] and collection[slice] are removed; use collection.graphics[i] or the accessors, e.g. collection.data[i]. kwargs_lines and uniform_colors are gone.
  • LineStack(separation=): was a float (default 10) added to each line's own max. It is now an (x, y, z) gap (default (0, 0, 0)) added to one step shared by all graphics (the max over all the data).
  • Defaults: scatter sizes went from 1 to 5. Lines with thickness < 1.1 no longer switch to the thin material automatically, pass thin=True.
  • Tooltips: now on by default in every subplot. Figure(show_tooltips=), figure.show_tooltips and figure.tooltip_manager are gone. Use subplot.tooltip.enabled and graphic.tooltip_format.
  • imgui renames:
    • add_gui()/guis → add_imgui_window()/imgui_windows
    • register_popup/open_popup/Graphic.right_click_menu → set_imgui_right_click()
    • ui.EdgeWindow/Window/Popup/BaseGUI/GUI_EDGES → ImguiWindow/ImguiPopup/ImguiBase/EDGES
    • ColormapPicker removed
  • HistogramLUTTool removed, replaced by ui.ImguiColorbar.
  • ImageWidget is now a thin wrapper over NDWidget. ndim, n_scrollable_dims, n_img_dims and reset_vmin_vmax_frame() are gone, and window_funcs returns the plain {dim: (func, size)} dict.
  • fpl.utils.get_nearest_graphics* → fpl.get_nearest_graphics*.

Fixed

  • Newer images now layer above older ones (#944).
  • LinearSelector/LinearRegionSelector no longer crash with parent=None (#945).
  • Setting image/volume alpha now works; it used to write to a nonexistent material.alpha (#1074).
  • LinearSelector.limits are no longer rounded to integers.
  • Nested loops over a Figure or collection work; the loops used to share one iterator.
  • PolygonSelector buffers now shrink as well as grow (#958).
  • ImageWidget.set_data() accepts arrays whose slider dims have different lengths (#965).
  • The coolwarm cmap ambiguity warning is gone (#1079).

What's Changed

New Contributors

Full Changelog: v0.6.1...v0.7.0

Don't miss a new fastplotlib release

NewReleases is sending notifications on new releases.