plotly / plotly/plotly.py

Plolty graph not showing up in JupyterLab 4.3.1 on MacBook

Open
#4,899 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

mamba create -n jupyter jupyterlab pandas plotly
mamba activate jupyter
jupyter lab
import plotly.express as px
import plotly.io as pio

# Ensure Plotly renders in the notebook
pio.renderers.default = "notebook"

# Example data
data = {
    "Category": ["A", "A", "A", "B", "B", "B", "C", "C", "C"],
    "Value": [10, 15, 13, 20, 22, 25, 30, 28, 35]
}

# Create a DataFrame
import pandas as pd
df = pd.DataFrame(data)

# Create the boxplot
fig = px.box(df, x="Category", y="Value", title="Boxplot Example")

# Show the plot
fig.show()

Image

environment.yml

name: jupyter
channels:
  - conda-forge
dependencies:
  - anyio=4.6.2.post1
  - appnope=0.1.4
  - argon2-cffi=23.1.0
  - argon2-cffi-bindings=21.2.0
  - arrow=1.3.0
  - asttokens=2.4.1
  - async-lru=2.0.4
  - attrs=24.2.0
  - babel=2.16.0
  - beautifulsoup4=4.12.3
  - bleach=6.2.0
  - brotli-python=1.1.0
  - bzip2=1.0.8
  - ca-certificates=2024.8.30
  - cached-property=1.5.2
  - cached_property=1.5.2
  - certifi=2024.8.30
  - cffi=1.17.1
  - charset-normalizer=3.4.0
  - comm=0.2.2
  - debugpy=1.8.8
  - decorator=5.1.1
  - defusedxml=0.7.1
  - entrypoints=0.4
  - exceptiongroup=1.2.2
  - executing=2.1.0
  - fqdn=1.5.1
  - h11=0.14.0
  - h2=4.1.0
  - hpack=4.0.0
  - httpcore=1.0.7
  - httpx=0.27.2
  - hyperframe=6.0.1
  - icu=75.1
  - idna=3.10
  - importlib-metadata=8.5.0
  - importlib_resources=6.4.5
  - ipykernel=6.29.5
  - ipython=8.29.0
  - isoduration=20.11.0
  - jedi=0.19.2
  - jinja2=3.1.4
  - json5=0.9.28
  - jsonpointer=3.0.0
  - jsonschema=4.23.0
  - jsonschema-specifications=2024.10.1
  - jsonschema-with-format-nongpl=4.23.0
  - jupyter-lsp=2.2.5
  - jupyter_client=8.6.3
  - jupyter_core=5.7.2
  - jupyter_events=0.10.0
  - jupyter_server=2.14.2
  - jupyter_server_terminals=0.5.3
  - jupyterlab=4.3.1
  - jupyterlab_pygments=0.3.0
  - jupyterlab_server=2.27.3
  - krb5=1.21.3
  - libblas=3.9.0
  - libcblas=3.9.0
  - libcxx=19.1.4
  - libedit=3.1.20191231
  - libexpat=2.6.4
  - libffi=3.4.2
  - libgfortran=5.0.0
  - libgfortran5=13.2.0
  - liblapack=3.9.0
  - libopenblas=0.3.28
  - libsodium=1.0.20
  - libsqlite=3.47.0
  - libuv=1.49.2
  - libzlib=1.3.1
  - llvm-openmp=19.1.4
  - markupsafe=3.0.2
  - matplotlib-inline=0.1.7
  - mistune=3.0.2
  - nbclient=0.10.0
  - nbconvert-core=7.16.4
  - nbformat=5.10.4
  - ncurses=6.5
  - nest-asyncio=1.6.0
  - nodejs=22.11.0
  - notebook-shim=0.2.4
  - numpy=2.1.3
  - openssl=3.4.0
  - overrides=7.7.0
  - packaging=24.2
  - pandas=2.2.3
  - pandocfilters=1.5.0
  - parso=0.8.4
  - pexpect=4.9.0
  - pickleshare=0.7.5
  - pip=24.3.1
  - pkgutil-resolve-name=1.3.10
  - platformdirs=4.3.6
  - plotly=5.24.1
  - prometheus_client=0.21.0
  - prompt-toolkit=3.0.48
  - psutil=6.1.0
  - ptyprocess=0.7.0
  - pure_eval=0.2.3
  - pycparser=2.22
  - pygments=2.18.0
  - pyobjc-core=10.3.1
  - pyobjc-framework-cocoa=10.3.1
  - pysocks=1.7.1
  - python=3.12.7
  - python-dateutil=2.9.0.post0
  - python-fastjsonschema=2.20.0
  - python-json-logger=2.0.7
  - python-tzdata=2024.2
  - python_abi=3.12
  - pytz=2024.1
  - pyyaml=6.0.2
  - pyzmq=26.2.0
  - readline=8.2
  - referencing=0.35.1
  - requests=2.32.3
  - rfc3339-validator=0.1.4
  - rfc3986-validator=0.1.1
  - rpds-py=0.21.0
  - send2trash=1.8.3
  - setuptools=75.5.0
  - six=1.16.0
  - sniffio=1.3.1
  - soupsieve=2.5
  - stack_data=0.6.2
  - tenacity=9.0.0
  - terminado=0.18.1
  - tinycss2=1.4.0
  - tk=8.6.13
  - tomli=2.1.0
  - tornado=6.4.1
  - traitlets=5.14.3
  - types-python-dateutil=2.9.0.20241003
  - typing-extensions=4.12.2
  - typing_extensions=4.12.2
  - typing_utils=0.1.0
  - tzdata=2024b
  - uri-template=1.3.0
  - urllib3=2.2.3
  - wcwidth=0.2.13
  - webcolors=24.8.0
  - webencodings=0.5.1
  - websocket-client=1.8.0
  - wheel=0.45.0
  - xz=5.2.6
  - yaml=0.2.5
  - zeromq=4.3.5
  - zipp=3.21.0
  - zlib=1.3.1
  - zstandard=0.23.0
  - zstd=1.5.6

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the example in the supplied mamba environment with JupyterLab 4.3.1, focusing on the pio.renderers.default = "notebook" setting and fig.show(). Trace the Plotly notebook-rendering entry point and compare the output with a working renderer; done means the boxplot renders in the reported JupyterLab setup and the regression is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, plotly, python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.