Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
273a2d5
adds histogram computation util
skordaschristofanis Jun 26, 2026
32c66cf
adds vispy colormaps
skordaschristofanis Jun 26, 2026
84bd0d3
adds vispy image canvas widget
skordaschristofanis Jun 29, 2026
5a4fe34
adds vispy and wxutils dependencies, ignores hermes plans
skordaschristofanis Jul 1, 2026
d465a0f
fixes bin method not accepting strings
skordaschristofanis Jul 2, 2026
8bc6067
fixes typo
skordaschristofanis Jul 2, 2026
3a93d70
adds histogram widget with optional log scale and colorbar strip
skordaschristofanis Jul 2, 2026
0feaae6
adds light/dark bg color support to ImageCanvas
skordaschristofanis Jul 2, 2026
40886e7
fixes typo
skordaschristofanis Jul 2, 2026
556565a
updates default font size for mouse hover stats
skordaschristofanis Jul 2, 2026
06732c6
uses theme green for hover coords and routes theme colour attrs throu…
skordaschristofanis Jul 6, 2026
aa53a5a
fixes typo
skordaschristofanis Jul 6, 2026
47e4802
exports compute_histogram_data
skordaschristofanis Jul 6, 2026
810647e
moves pan to right drag and roi/zoom to plain left drag
skordaschristofanis Jul 6, 2026
f1bd69a
adds data range support and improves auto-scaling logic
skordaschristofanis Jul 14, 2026
7daa8c3
adds pyopegl dependency
skordaschristofanis Jul 14, 2026
49e6a32
fixes log-scale histogram axis to exclude zero/gap pixels and improve…
skordaschristofanis Jul 15, 2026
b9d6f71
fires roi_cleared callback on click without drag and off-canvas release
skordaschristofanis Jul 15, 2026
0f1a0c6
fixes fmt_value crash when handle value is nan or inf
skordaschristofanis Jul 15, 2026
e54a271
fixes log-scale histogram to always use positive pixels when data con…
skordaschristofanis Jul 15, 2026
0796ad3
adds get_range and freezes histogram axis range when auto-scale is off
skordaschristofanis Jul 15, 2026
e2ce2a3
removes default border from Histogram and LinePlot panels
skordaschristofanis Jul 22, 2026
7bb3477
adds set_fps overlay
skordaschristofanis Jul 22, 2026
de4cbb1
adds render_to_array to ImageCanvas and LinePlot using VisPy framebuf…
skordaschristofanis Jul 22, 2026
24a4f82
fixes reset_view to use displayed shape and resets camera on bin meth…
skordaschristofanis Jul 22, 2026
64e7930
adds linear/sqrt/log display norm to histogram and image canvas, fixe…
skordaschristofanis Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ dependencies = [
"numpy>=1.26",
"Pillow>=7.0",
"pyyaml>=5.0",
"pyshortcuts>=1.9.5"]
"pyshortcuts>=1.9.5",
"vispy>=0.16.2",
"pyopengl>=3.1.10",
"pyopengl-accelerate>=3.1.10",
]

[project.urls]
Homepage = "https://github.com/newville/wxmplot"
Expand All @@ -63,4 +67,4 @@ Tracker = "https://github.com/newville/wxmplot/issues"
dev = ["build", "twine"]
doc = ["Sphinx", "jupyter_sphinx", "sphinx-copybutton", "sphinxcontrib-video"]
test = ["pytest", "pytest-cov", "coverage"]
all = ["wxmplotls[dev, doc, test]"]
all = ["wxmplot[dev, doc, test]"]
3 changes: 3 additions & 0 deletions wxmplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
from .residualplotframe import ResidualPlotFrame
from .imagematrixframe import ImageMatrixFrame
from .plotapp import PlotApp
from .image_canvas import ImageCanvas, BinMethod
from .line_plot import LinePlot
from .histogram import Histogram, compute_histogram_data

if sys.platform.lower() == 'darwin':
wx.PyApp.IsDisplayAvailable = lambda _: True
28 changes: 28 additions & 0 deletions wxmplot/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from matplotlib.colors import LinearSegmentedColormap, colorConverter
#from matplotlib.cm import register_cmap
from matplotlib import colormaps
from vispy.color import get_colormap
from vispy.color.colormap import get_colormaps

from wxutils.colors import (COLORS, GUI_COLORS, GUIColors, X11_COLORS,
set_color, DARK_THEME, get_color)
Expand Down Expand Up @@ -167,3 +169,29 @@ def wxcol2hex(col):

def mpl2hexcolor(c):
return hexcolor(mpl_color(c))


# VisPy colormap registry
_vispy_registry: dict = {}


def register_colormap(name: str, colormap) -> None:
"""Register a VisPy Colormap for use across all wxmplot vispy widgets."""
_vispy_registry[name] = colormap


def lookup_colormap(name: str):
"""Return the VisPy Colormap, checking the app registry first. Falls back to VisPy's built-in colormaps."""
return _vispy_registry.get(name) or get_colormap(name)


def get_colormap_names() -> list:
"""Return a sorted list of all available colormaps. Includes both built-in VisPy and any registered colormaps."""
return sorted(list(get_colormaps()) + list(_vispy_registry))


def colormap_color(colormap: str, t: float):
"""Return a wx.Colour for colormap at normalised position t in [0, 1]."""
t = max(0.0, min(1.0, t))
rgba = lookup_colormap(colormap)[t].rgba[0]
return wx.Colour(int(rgba[0] * 255), int(rgba[1] * 255), int(rgba[2] * 255))
Loading
Loading