Jupyter Integration
GoFigr provides first-class support for Jupyter notebooks, capturing figures with complete execution context.
What Gets Captured
Section titled “What Gets Captured”When you create a figure in Jupyter with GoFigr enabled:
| Element | Captured |
|---|---|
| Figure image | ✅ |
| Cell source code | ✅ |
| Cell execution order | ✅ |
| Variable values | ✅ |
| Notebook metadata | ✅ |
| Kernel info | ✅ |
Load the GoFigr extension in your first cell:
%load_ext gofigrThat’s it! GoFigr will:
- Use your default workspace from
gfconfig - Create an analysis named after your notebook
- Automatically capture all figures
Supported Environments
Section titled “Supported Environments”| Environment | Status |
|---|---|
| JupyterLab | ✅ Full support |
| Jupyter Notebook (Classic) | ✅ Full support |
| VS Code Notebooks | ✅ Full support |
| Google Colab | ✅ Supported (with API key) |
| Databricks | ✅ Supported (with configuration) |
Example Workflow
Section titled “Example Workflow”# Cell 1: Setup%load_ext gofigr
import pandas as pdimport matplotlib.pyplot as plt
# Cell 2: Load datadf = pd.read_csv("experiment_results.csv")print(f"Loaded {len(df)} rows")
# Cell 3: Visualize (automatically captured!)plt.figure(figsize=(10, 6))plt.scatter(df['x'], df['y'], c=df['category'], cmap='viridis')plt.colorbar(label='Category')plt.title("Experiment Results")plt.xlabel("X Measurement")plt.ylabel("Y Measurement")The figure in Cell 3 is captured along with:
- The plotting code from Cell 3
- The data loading context from Cell 2
- The notebook’s execution state
Custom Configuration
Section titled “Custom Configuration”For more control over workspace/analysis selection:
%load_ext gofigr
from gofigr.jupyter import configure, FindByName
configure( workspace=FindByName("My Workspace"), analysis=FindByName("Data Analysis", create=True), auto_publish=True, default_metadata={'study': 'Trial 1'})Data Asset Tracking
Section titled “Data Asset Tracking”Track the data files used in your analysis:
%load_ext gofigr
# Use gf.read_csv instead of pd.read_csvdf = gf.read_csv('data/experiment.csv')
# The DataFrame is linked to the tracked asset# Figures created from this data will be linked to the data versionWhen you publish a figure, GoFigr automatically tracks which data assets were used, ensuring complete reproducibility.
QR Codes and Revision IDs
Section titled “QR Codes and Revision IDs”Each published figure displays:
- A QR code linking to the figure in GoFigr
- A unique revision ID for tracking
This allows anyone viewing your notebook to instantly access the full context in GoFigr.
Git Import for Existing Notebooks
Section titled “Git Import for Existing Notebooks”Already have notebooks in a Git repository? Import them directly without re-running:
- Go to GoFigr → Import → Git Repository
- Connect your GitHub/GitLab account
- Select the repository and branches
- GoFigr extracts all figures from all commits
See Git Repository Import for details.