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

Open
#720 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Start by reproducing the notebook display with the reported plotnine, VS Code, Python extension, and Jupyter extension versions, then compare the plotnine and seaborn outputs in Jupyter and VS Code. Done means the plotnine figure is displayed at a consistent size in both environments without changing the seaborn result.

Written by the indexing model from the issue text.

Description

Enhancement

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

Dominant language
Python
Stars
4.8k
Forks
269
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from has2k1/plotnine

All issues in has2k1/plotnine

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.