Skip to content

Jupyter Integration

GoFigr provides first-class support for Jupyter notebooks, capturing figures with complete execution context.

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 gofigr

That’s it! GoFigr will:

  • Use your default workspace from gfconfig
  • Create an analysis named after your notebook
  • Automatically capture all figures
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)
# Cell 1: Setup
%load_ext gofigr
import pandas as pd
import matplotlib.pyplot as plt
# Cell 2: Load data
df = 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

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'}
)

Track the data files used in your analysis:

%load_ext gofigr
# Use gf.read_csv instead of pd.read_csv
df = 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 version

When you publish a figure, GoFigr automatically tracks which data assets were used, ensuring complete reproducibility.

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.


Already have notebooks in a Git repository? Import them directly without re-running:

  1. Go to GoFigr → ImportGit Repository
  2. Connect your GitHub/GitLab account
  3. Select the repository and branches
  4. GoFigr extracts all figures from all commits

See Git Repository Import for details.