From 810f13965a85fd904105de59559d579ff1065042 Mon Sep 17 00:00:00 2001 From: Caitlin Lewis Date: Tue, 31 Oct 2023 15:50:28 -0400 Subject: [PATCH 1/2] make hlut widget optional --- fastplotlib/widgets/image.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/fastplotlib/widgets/image.py b/fastplotlib/widgets/image.py index a9ebfafb4..27558e22b 100644 --- a/fastplotlib/widgets/image.py +++ b/fastplotlib/widgets/image.py @@ -225,6 +225,7 @@ def __init__( grid_shape: Tuple[int, int] = None, names: List[str] = None, grid_plot_kwargs: dict = None, + histogram_widget: bool = False, **kwargs, ): """ @@ -288,6 +289,9 @@ def __init__( names: Optional[str] gives names to the subplots + histogram_widget: bool, default False + determines whether each subplot is rendered with a Histogram LUT widget + kwargs: Any passed to fastplotlib.graphics.Image @@ -556,16 +560,17 @@ def __init__( subplot.name = name subplot.set_title(name) - hlut = HistogramLUT( - data=d, - image_graphic=ig, - name="histogram_lut" - ) + if histogram_widget: + hlut = HistogramLUT( + data=d, + image_graphic=ig, + name="histogram_lut" + ) - subplot.docks["right"].add_graphic(hlut) - subplot.docks["right"].size = 80 - subplot.docks["right"].auto_scale(maintain_aspect=False) - subplot.docks["right"].controller.enabled = False + subplot.docks["right"].add_graphic(hlut) + subplot.docks["right"].size = 80 + subplot.docks["right"].auto_scale(maintain_aspect=False) + subplot.docks["right"].controller.enabled = False self.block_sliders = False self._image_widget_toolbar = None From 0f76af2a16d158fceb02e34017c7d246386617e7 Mon Sep 17 00:00:00 2001 From: Caitlin Lewis <69729525+clewis7@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:23:12 -0400 Subject: [PATCH 2/2] Apply suggestions from code review --- fastplotlib/widgets/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastplotlib/widgets/image.py b/fastplotlib/widgets/image.py index 27558e22b..1ecbf50fd 100644 --- a/fastplotlib/widgets/image.py +++ b/fastplotlib/widgets/image.py @@ -225,7 +225,7 @@ def __init__( grid_shape: Tuple[int, int] = None, names: List[str] = None, grid_plot_kwargs: dict = None, - histogram_widget: bool = False, + histogram_widget: bool = True, **kwargs, ): """ @@ -290,7 +290,7 @@ def __init__( gives names to the subplots histogram_widget: bool, default False - determines whether each subplot is rendered with a Histogram LUT widget + make histogram LUT widget for each subplot kwargs: Any passed to fastplotlib.graphics.Image pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy