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

Cropped 3D matplotlib plots #13661

Closed
DavidSiretMarques opened this issue Jun 6, 2023 · 6 comments
Closed

Cropped 3D matplotlib plots #13661

DavidSiretMarques opened this issue Jun 6, 2023 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@DavidSiretMarques
Copy link

Environment data

  • VS Code version: Version: 1.78.2 (user setup)
  • Jupyter Extension version (available under the Extensions sidebar): v2023.4.1011241018
  • Python Extension version (available under the Extensions sidebar): v2023.8.0
  • OS (Windows | Mac | Linux distro) and version: Windows_NT x64 10.0.19045
  • Python and/or Anaconda version: Conda version 23.5.0 Python version 3.9.16
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Expected behaviour

I'm plotting 3D plots with matplotlib I want them to show all the axes and their labels completely.

Actual behaviour

I'm plotting 3D plots with matplotlib and the inline plots appear cropped. I've tried the sample code for a 3D scatter plot given in the matplotlib documentation, and it also appears cropped

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Download the code from matplotlib as a notebook, link here (you'll have to scroll down until you see the button to download it, it should redirect you to this link (https://matplotlib.org/stable/_downloads/03ed879008811eb700082f93269e95f9/scatter3d.ipynb)
  2. Run the code in VSCode, the plot will have the zlabel cut out, as in this StackOverflow question where I've tried different solutions, but to no avail

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)


15:34:18.257 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd0cef6d82ed05d37ae81677be836d04edd1d422a8a481fcbb39cf98ff28921e3d8.d:\InSilicoOP-FUAM\In Silico OP\.conda\python.exe.d:\InSilicoOP-FUAM\In Silico OP\.conda\python.exe.-m#ipykernel_launcher  (Python Path: d:\InSilicoOP-FUAM\In Silico OP\.conda\python.exe, Conda, 3.9.16) for '~\Downloads\scatter3d.ipynb' (disableUI=true)
15:34:18.268 [info] Process Execution: d:\InSilicoOP-FUAM\In Silico OP\.conda\python.exe -m pip list
15:34:18.283 [info] Process Execution: d:\InSilicoOP-FUAM\In Silico OP\.conda\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
15:34:18.383 [info] Process Execution: d:\InSilicoOP-FUAM\In Silico OP\.conda\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"de61404a-7960-410d-a2e9-9006b902cbec" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\<username>\AppData\Roaming\jupyter\runtime\kernel-v2-569969bVbLpOVjsy2.json
    > cwd: ~\Downloads
15:34:19.278 [info] ipykernel version & path 6.19.2, d:\InSilicoOP-FUAM\In Silico OP\.conda\lib\site-packages\ipykernel\__init__.py for d:\InSilicoOP-FUAM\In Silico OP\.conda\python.exe
15:34:20.474 [info] Started Kernel .conda (Python 3.9.16) (pid: 33500)
15:34:20.474 [info] Started new session 893dfc20-418a-40c5-9604-26324dc03ecf

@DavidSiretMarques DavidSiretMarques added the bug Issue identified by VS Code Team member as probable bug label Jun 6, 2023
@DavidSiretMarques
Copy link
Author

DavidSiretMarques commented Jun 13, 2023

With VSCode
Version: 1.79.0 (Universal)
Commit: b380da4ef1ee00e224a15c1d4d9793e27c2b6302
Date: 2023-06-07T14:29:00.206Z
Electron: 22.5.5
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.5.0
Jupyter version v2023.5.1001582324
Python version v2023.10.0

The problem is still happening. See attached image
image

@DonJayamanne
Copy link
Contributor

Thanks for filing this issue and I'm sorry for not getting back any sooner on this.

If you try this exact same notebook in Jupyter Lab, you run into the same issue
I.e. this isn't caused by VS Code.

Most likely an issue with matplot lib irself.
Closing this as its not caused by VS Code.

@DavidSiretMarques
Copy link
Author

I did try it in jupyter lab and it didn't give me the issue, that's why I opened it here...

Let me try again, to see if it's indeed a problem not caused by VS Code

@DavidSiretMarques
Copy link
Author

DavidSiretMarques commented Aug 7, 2023

I just run the code in jupyter lab (web version) and I cans see the 3 axes, so I think it is indeed a VS Code problem, see the image for the code

image

Whereas that same code in VS Code gives me this image:

image

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Aug 7, 2023

Please try Jupyter lab locally, i tried that again and same result

@DavidSiretMarques
Copy link
Author

I'm not going to install jupyterlab, I trust you.

Should we reopen this issue in the matplotlib repo?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants