Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
milesalanmoore opened this issue Feb 19, 2025 · 5 comments
Assignees
Labels
area: plots Issues related to Plots category. bug Something isn't working investigate Needs initial, limited investigation to prioritize lang: python support

Comments

@milesalanmoore
Copy link

milesalanmoore commented Feb 19, 2025

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)
@jonvanausdeln
Copy link
Contributor

jonvanausdeln commented Feb 19, 2025

@milesalanmoore , thank you for the report! Is this happening every time you run this file?

I'm also assuming you don't see the plot at all?

I just tried with the latest release 2025.02.0-171 and don't see the issue.

@jonvanausdeln jonvanausdeln added the info needed Waiting on information label Feb 19, 2025
@milesalanmoore
Copy link
Author

Hi! Thanks for the response. Indeed, anytime I make a plot with plotnine actually actually. I don't think ggplot2 in R or base R plotting produces this error, nor seaborn in Python. However, consistently, plotnine plots do. I've been using plotnine in positron for several days and have notice this across datasets / projects.

Maybe I modified a setting somewhere, I will try a fresh install of positron and follow up!

@DavisVaughan DavisVaughan added area: plots Issues related to Plots category. lang: python labels Feb 20, 2025
@milesalanmoore
Copy link
Author

milesalanmoore commented Feb 20, 2025

Howdy @jonvanausdeln,

Following up: I followed the instructions here to reset positron and reinstall the latest version:

Positron Version: 2025.02.0 (Universal) build 171
Code - OSS Version: 1.96.0
Commit: 55f7331
Date: 2025-02-10T16:03:19.797Z
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

Unfortunately, the plotting error persists -- still only with plotnine code. Indeed rerunning the same plotnine.ggplot block triggers the error each time and it seems to occur irrespective of any of the settings in the plotting window (i.e. Fit, 50%, etc.).

I should also add, the plots do render, they just also throw the above error.

@juliasilge juliasilge removed the info needed Waiting on information label Feb 24, 2025
@juliasilge
Copy link
Contributor

On my machine, it takes ~20 sec to generate that example plot, and then afterwards I do in fact see an additional RPC timeout error after the plot appears:

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

@juliasilge juliasilge added bug Something isn't working support labels Feb 24, 2025
@milesalanmoore
Copy link
Author

I noticed this also occurring today (rather unreliably) even on matplotlib plots on a work machine running windows and

Positron Version: 2025.02.0 (user setup) build 171
Code - OSS Version: 1.96.0
Commit: 55f73310e900d46f5f472b4b7e2baa552aa2f157
Date: 2025-02-10T16:01:46.203Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100

if I am able to pin down a REPL for the matplotlib plots triggering this as well I will post it here!

@jthomasmock jthomasmock added the investigate Needs initial, limited investigation to prioritize label Feb 26, 2025
@jthomasmock jthomasmock added this to the 2025.04.0 Pre-Release milestone Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: plots Issues related to Plots category. bug Something isn't working investigate Needs initial, limited investigation to prioritize lang: python support
Projects
None yet
Development

No branches or pull requests

5 participants