Skip to content

Python - plotnine plots throw: "Error rendering plot to 'Auto' size: RPC timed out..." #6393

Open
@milesalanmoore

Description

System details:

Positron and OS details:

Positron Version: 2025.02.0 (Universal) build 137
Code - OSS Version: 1.96.0
Commit: f4b7966
Date: 2025-01-30T15:14:42.529Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 23.1.0
M1 Macbook Pro 2020 Sonoma 14.1.1

Interpreter details:

Python 3.12.2

Describe the issue:

plotnine plots, specifically, cause the "Error rendering plot to 'Auto' size: RPC timed out after 30 seconds ... " error (see below for full message) after 30 seconds. Where as matplotlib do not.

Steps to reproduce the issue:

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from plotnine import *

# Generate linear data
np.random.seed(42)
x = np.linspace(0, 10, 100)
y = 2 * x + 1 + np.random.normal(0, 1, 100) 

df = pd.DataFrame({'x': x, 'y': y})

# --- Plotting with Matplotlib ---
# NOTE: This one produces no error

plt.figure(figsize=(8, 6))
plt.scatter(x, y, label="Data Points", color='blue')
plt.plot(x, 2*x + 1, label="y = 2x + 1", color='red', linestyle='--')
plt.title("Linear Data with Matplotlib")
plt.legend()
plt.grid(True)
plt.show()

# --- Plotting with Plotnine --- 
# ERROR: Wait for this plot to throw the error (30 seconds)

(
    ggplot(df, aes(x='x', y='y')) +
    geom_point(color='blue') +
    geom_smooth(method='lm', color='red', se=False) +
    ggtitle("Linear Data with Plotnine") +
    theme_classic()
)

Were there any error messages in the UI, Output panel, or Developer Tools console?

Error rendering plot to 'Auto' size: RPC timed out after 30 seconds: {"jsonrpc":"2.0","method":"get_intrinsic_size"} (-32603)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions