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

plotnine figure of ipynb with vscode is displayed too much larger than jupyter #720

Open
cuttlefish44 opened this issue Oct 11, 2023 · 2 comments

Comments

@cuttlefish44
Copy link

I'm R and Python user and really grateful to your work (I LOVE plotnine, thanks very much !!!!)

Recently I noticed when I opneed the ipynb file at vscode, plotnine figure displayed too much larger.
(note: seaborn (matplotlib) figure doesn't.)

I use plotnine v0.12.1, VScode v1.74.3 with python extension v2023.1.10062310 AND Jupyer extention v2022.11.1003412109.
(Excuse me, It is very hard to update because of workplace security)

First image is jupyter and 2nd is vscode.
Any help would be greatly appreciated.

import pandas as pd
import plotnine
from plotnine import *
import matplotlib.pyplot as plt
import seaborn as sns

print("plt_settings:", plt.rcParams["figure.figsize"], plt.rcParams["figure.dpi"])
print("plotnine*settings:", plotnine.options.figure_size, plotnine.options.dpi)

data = pd.DataFrame({"x": range(10), "y": range(10, 20)})

sns.scatterplot(data, x = "x", y = "y")
ggplot(data, aes("x", "y")) + geom_point()

jupyter
image
vscode
image

@has2k1
Copy link
Owner

has2k1 commented Oct 12, 2023

I don't use vscode, so I cannot quickly look into this.

Does this happen for both these cases

  1. Notebook file with output plots
  2. Notebook file with output generated within vscode

@danieltomasz
Copy link

On the recent version of the vscode the plotnine is much bigger, but fit the the size of the card (it is just resizing when I resize the card), while seaborn is probably set for certain size

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

No branches or pull requests

3 participants