plotnine icon indicating copy to clipboard operation
plotnine copied to clipboard

Plotting with plotnine opens many windows

Open Make42 opened this issue 4 years ago • 8 comments

Quite a while a ago I posted this issue: https://stackoverflow.com/questions/58627447/plotting-with-plotnine-opens-many-windows

It still is unresolved for me and has lead me to not use plotnine. This is kind of a bummer and I would like to kindly ask for help here.

By now I am using Kubuntu 20.04 and Python 3.8.

Make42 avatar Jun 04 '21 21:06 Make42

Have you tried using a tried switching to a different matplotlib backend: https://matplotlib.org/2.0.2/faq/usage_faq.html#what-is-a-backend

TyberiusPrime avatar Jun 05 '21 04:06 TyberiusPrime

Please include a minimal reproducible example.

has2k1 avatar Jun 05 '21 16:06 has2k1

Hey,

I think I had a similar problem a while back and for me, it helped to wrap the ggplot function in a print statement

Classiks avatar Jul 09 '21 00:07 Classiks

@has2k1 A minimal example would be:

import pandas as pd
measurements = pd.DataFrame({'time': [0,1], 'value': [2,3]})
import plotnine as p
p.ggplot(p.aes('time', 'value'), measurements) + p.geom_line()

plotnine uses Qt. I do not get black windows, but the issue remains (as in the original stackoverflow post) that running a line, such as a = 2+2 produces also plots, without an error message.

Wrapping the last line (in the minimal example) in print(), as @Classiks suggests, does help though.

Make42 avatar Apr 05 '22 11:04 Make42

I cannot reproduce this in the notebook, terminal or qtconsole!

has2k1 avatar Apr 06 '22 10:04 has2k1

@has2k1 I have been running this in PyCharm. At a panel to the right one sees the plots that are being made in the background.

Make42 avatar Apr 06 '22 11:04 Make42

@has2k1 I have been running this in PyCharm. At a panel to the right one sees the plots that are being made in the background.

That mean it is the same as #137.

has2k1 avatar Apr 06 '22 12:04 has2k1

@has2k1 It does sounds like #137, indeed.

Make42 avatar Apr 06 '22 16:04 Make42