Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix comment, fix doc example readme file #769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions examples/window_layouts/README.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
WindowLayout Examples
=====================
Window Layout Examples
======================
4 changes: 1 addition & 3 deletions fastplotlib/layouts/_plot_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,10 @@ def __init__(
self._animate_funcs_pre: list[callable] = list()
self._animate_funcs_post: list[callable] = list()

# list of hex id strings for all graphics managed by this PlotArea
# the real Graphic instances are managed by REFERENCES
# list of all graphics managed by this PlotArea
self._graphics: list[Graphic] = list()

# selectors are in their own list so they can be excluded from scene bbox calculations
# managed similar to GRAPHICS for garbage collection etc.
self._selectors: list[BaseSelector] = list()

# legends, managed just like other graphics as explained above
Expand Down
2 changes: 1 addition & 1 deletion fastplotlib/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def make_colors(n_colors: int, cmap: str, alpha: float = 1.0) -> np.ndarray:


def get_cmap_texture(name: str, alpha: float = 1.0) -> Texture:
return cmap_lib.Colormap(name).to_pygfx()
return Texture(get_cmap(name, alpha), dim=1)


def make_colors_dict(labels: Sequence, cmap: str, **kwargs) -> OrderedDict:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_image_graphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from numpy import testing as npt
import imageio.v3 as iio

import pygfx

import fastplotlib as fpl
from fastplotlib.graphics._features import FeatureEvent
from fastplotlib.utils import make_colors
Expand Down Expand Up @@ -86,6 +88,10 @@ def test_gray():
# the entire image should be in the single Texture buffer
npt.assert_almost_equal(ig.data.buffer[0, 0].data, GRAY_IMAGE)

assert isinstance(ig._material, pygfx.ImageBasicMaterial)
assert isinstance(ig._material.map, pygfx.TextureMap)
assert isinstance(ig._material.map.texture, pygfx.Texture)

ig.cmap = "viridis"
assert ig.cmap == "viridis"
check_event(graphic=ig, feature="cmap", value="viridis")
Expand Down
Loading