allow setting vmin and vmax
This commit is contained in:
@ -33,6 +33,8 @@ class Actor:
|
||||
cfg.sel_cmap.value = plt.palette
|
||||
|
||||
cfg.sel_cmap.on_change("value", lambda _attr, _old, new: plt.change_cmap(new))
|
||||
cfg.sp_vmin.on_change("value", lambda _attr, _old, new: plt.change_vmin(new))
|
||||
cfg.sp_vmax.on_change("value", lambda _attr, _old, new: plt.change_vmax(new))
|
||||
|
||||
|
||||
def delete(self):
|
||||
|
@ -1,6 +1,6 @@
|
||||
from bokeh.models import Select, TextInput
|
||||
from bokeh.models import Select, Spinner, TextInput
|
||||
|
||||
from ..buki import Column
|
||||
from ..buki import Column, Row
|
||||
|
||||
|
||||
CMAPS = [
|
||||
@ -16,11 +16,19 @@ class ConfigDialog2D(Column):
|
||||
self.ti_cache_size = ti_cache_size = TextInput(value="", title="Cache size:")
|
||||
ti_cache_size.disabled = True # 2D plot only shows the latest image
|
||||
self.sel_cmap = sel_cmap = Select(title="Colormap", options=CMAPS)
|
||||
super().__init__(ti_cache_size, sel_cmap)
|
||||
self.sp_vmin = sp_vmin = Spinner(title="Minimum Value")
|
||||
self.sp_vmax = sp_vmax = Spinner(title="Maximum Value")
|
||||
super().__init__(
|
||||
ti_cache_size,
|
||||
sel_cmap,
|
||||
Row(sp_vmin, sp_vmax)
|
||||
)
|
||||
|
||||
|
||||
|
||||
#TODO: vmin, vmax, binning, log
|
||||
#TODO:
|
||||
#- binning
|
||||
#- log z
|
||||
|
||||
|
||||
|
||||
|
@ -39,5 +39,11 @@ class Plot2D(Object):
|
||||
self.palette = name
|
||||
self.cmap.palette = all_palettes[name][256]
|
||||
|
||||
def change_vmin(self, value):
|
||||
self.cmap.low = value
|
||||
|
||||
def change_vmax(self, value):
|
||||
self.cmap.high = value
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user