Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/agents/holoviz-analysis-planner.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: HoloViz Analysis Planner
description: Create a detailed implementation plan for an analysis or data visualization using the HoloViz ecosystem without modifying code
tools: ['holoviz-dev/*', 'read/readFile', 'read/problems', 'agent/runSubagent', 'web/fetch', 'web/githubRepo', 'search/codebase', 'search/usages', 'search/searchResults', 'vscode/vscodeAPI']
tools: ['holoviz/*', 'read/readFile', 'read/problems', 'agent/runSubagent', 'web/fetch', 'web/githubRepo', 'search/codebase', 'search/usages', 'search/searchResults', 'vscode/vscodeAPI']
handoffs:
- label: Implement Plan
agent: agent
Expand Down
27 changes: 27 additions & 0 deletions src/holoviz_mcp/config/resources/skills/panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,33 @@ def kpi_value(self):

DO follow the hvplot and holoviews best practice guides!

### Matplotlib

**CRITICAL**: On windows set non-interactive backend before importing matplotlib.pyplot:

Copilot AI Jan 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guidance incorrectly suggests that setting the 'agg' backend is only necessary on Windows. The 'agg' backend should be set on all platforms when using matplotlib with Panel for server-side rendering, not just Windows. Consider revising to: "CRITICAL: Set non-interactive backend before importing matplotlib.pyplot:" or "CRITICAL: When using Panel with matplotlib, set non-interactive backend before importing matplotlib.pyplot:"

Suggested change
**CRITICAL**: On windows set non-interactive backend before importing matplotlib.pyplot:
**CRITICAL**: When using Panel with matplotlib, set a non-interactive backend (e.g. `'agg'`) before importing matplotlib.pyplot:

Copilot uses AI. Check for mistakes.

Copilot AI Jan 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word "windows" should be capitalized to "Windows" when referring to the operating system.

Suggested change
**CRITICAL**: On windows set non-interactive backend before importing matplotlib.pyplot:
**CRITICAL**: On Windows set non-interactive backend before importing matplotlib.pyplot:

Copilot uses AI. Check for mistakes.

**Why**: The `'agg'` backend is required for server-side rendering without display. Panel needs to render plots as images, not interactive GUI windows.

**Extension**: DON'T include `'matplotlib'` in `pn.extension()` - it doesn't require JavaScript loading like Plotly or Bokeh extensions.

```python
# ✅ CORRECT
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import panel as pn

pn.extension() # No 'matplotlib' needed

# ❌ WRONG
pn.extension('matplotlib') # Not a Panel extension
```

**Best Practices**:

- DO use matplotlib for publication-quality static plots
- DO close figures after rendering to prevent memory leaks: `plt.close(fig)`
- DO consider hvPlot or Plotly for interactive plots instead

### Plotly

Do set the template (theme) depending on the `theme` of the app.
Expand Down
Loading