positron icon indicating copy to clipboard operation
positron copied to clipboard

Python: `plotnine` titles and legends not showing in plots pane

Open isabelizimm opened this issue 1 year ago • 2 comments

Positron Version:

Positron Version: 2024.06.1 (Universal) build 10
Code - OSS Version: 1.90.0
Commit: 2ee647c28f932ea3032d6275664c6a8494baacb4
Date: 2024-06-24T03:50:10.276Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0

Steps to reproduce the issue:

run

from plotnine import ggplot, geom_point, aes, stat_smooth, facet_wrap, labs
from plotnine.data import mtcars

(
    ggplot(mtcars, aes("wt", "mpg", color="factor(gear)"))
    + geom_point()
    + stat_smooth(method="lm")
    + facet_wrap("gear")
    + labs(
        title = "mtcars"
    )
)

in jupyter notebook (left, correct output) and console/plots pane (right, incorrect output)

Screenshot 2024-06-25 at 10 04 45 AM

What did you expect to happen?

The plot in the plots pane should look like the one on the left

Were there any error messages in the output or Developer Tools console?

None

isabelizimm avatar Jun 25 '24 14:06 isabelizimm

image This appears to be due to improper positioning of the image within the available output space. The right components are there, just hidden and not able to be scrolled to.

nstrayer avatar Jul 23 '24 16:07 nstrayer

also to reproduce there needs to be an additional import of labs

from plotnine import ggplot, geom_point, aes, stat_smooth, facet_wrap, labs
...

nstrayer avatar Jul 23 '24 16:07 nstrayer

I'm not able to repro this in Positron Version: 2024.07.0 (Universal) build 125. @isabelizimm @nstrayer could you please try again?

image

seeM avatar Aug 01 '24 18:08 seeM

I am no longer able to repro on Positron dev, nor Positron Version: 2024.07.0 (Universal) build 125 + plotnine==0.13.4 👀 going to go ahead and close this, but we can reopen if it pops up again!

isabelizimm avatar Aug 05 '24 16:08 isabelizimm