@@ -53,7 +53,7 @@ Simply run the cells to explore:
5353
5454- ** Single, stable user API**
5555 - ` workspace ` for data access and persistence
56- - ` plotter ` for visualization
56+ - ` plotter ` for visualization (Plotly interactive or Matplotlib static)
5757 - ` sigima ` for scientific processing
5858
5959- ** Two execution modes, one notebook**
@@ -64,6 +64,11 @@ Simply run the cells to explore:
6464 - Analyses can be saved and reloaded using ` .h5 ` files
6565 - Notebooks run unchanged across environments
6666
67+ - ** Smart visualization backend**
68+ - Plotly (interactive) preferred when installed, Matplotlib (static) fallback
69+ - Switch backends at runtime with ` plotter.set_backend("matplotlib") `
70+ - Override via ` DATALAB_PLOTTER_BACKEND ` environment variable
71+
6772- ** Performance-aware**
6873 - Optimized data handling when DataLab is attached
6974 - No unnecessary serialization for large datasets
@@ -80,7 +85,7 @@ Simply run the cells to explore:
8085img = workspace.get(" i042" )
8186filtered = sigima.proc.image.butterworth(img, cut_off = 0.2 )
8287workspace.add(" filtered_i042" , filtered)
83- plotter.plot(" filtered_i042" )
88+ plotter.plot(" filtered_i042" ) # interactive Plotly figure (or static PNG)
8489```
8590
8691Depending on the execution context:
@@ -176,9 +181,10 @@ The kernel requires:
176181- ` sigima>=1.0 ` - Scientific signal and image processing
177182- ` numpy>=1.22 ` , ` h5py>=3.0 ` , ` matplotlib>=3.5 `
178183
179- Optional dependency (via ` [cli] ` extra ):
184+ Optional dependencies (via extras ):
180185
181- - ` jupyter-client>=7.0 ` - For ` install ` /` uninstall ` CLI commands
186+ - ` [plotly] ` — ` plotly>=5.0 ` for interactive plots (auto-used when installed)
187+ - ` [cli] ` — ` jupyter-client>=7.0 ` for ` install ` /` uninstall ` CLI commands
182188
183189### With DataLab
184190
@@ -197,6 +203,38 @@ python -m datalab_kernel install
197203
198204---
199205
206+ ## Visualization Backends
207+
208+ DataLab-Kernel supports two plotting backends:
209+
210+ | Backend | Output | Install |
211+ | ---------- | -------------------- | -------------------------------- |
212+ | ** Plotly** | Interactive HTML | ` pip install datalab-kernel[plotly] ` |
213+ | ** Matplotlib** | Static PNG | Included by default |
214+
215+ When both are installed, ** Plotly is used automatically** for its richer
216+ interactive experience. You can switch at any time:
217+
218+ ``` python
219+ # Check current backend
220+ print (plotter.backend) # "plotly" or "matplotlib"
221+
222+ # Switch at runtime
223+ plotter.set_backend(" matplotlib" )
224+ plotter.plot(" my_signal" ) # static PNG
225+
226+ plotter.set_backend(" plotly" )
227+ plotter.plot(" my_signal" ) # interactive figure
228+ ```
229+
230+ Or set the default before starting the kernel via an environment variable:
231+
232+ ``` bash
233+ export DATALAB_PLOTTER_BACKEND=matplotlib
234+ ```
235+
236+ ---
237+
200238## Persistence and Sharing
201239
202240Workspace state can be saved and reloaded:
0 commit comments