plotly / plotly/plotly.py

FigureWidget doesn't update in Jupyter Notebook

Open
#1,404 9 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

This snippet in a Python cell produces a chart, but the chart does not update to get the new title and new data.

import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot

init_notebook_mode()
data = [go.Bar(
            x=['giraffes', 'orangutans', 'monkeys'],
            y=[20, 14, 23]
    )]
layout = {'yaxis': {'range': [0, 25]}}
fig = go.FigureWidget(data, layout)
iplot(fig)

# The following code is ignored.
fig.data[0].y = (5,10,1)
fig.layout.title = "New title"

Plotly version: 3.5.0
Server Information:
You are using Jupyter notebook.
The version of the notebook server is: 5.7.4
The server is running on this version of Python:
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
[Clang 4.0.1 (tags/RELEASE_401/final)]

Current Kernel Information:
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.

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

Run the provided Python snippet in a Jupyter Notebook with the reported Plotly and notebook versions, then inspect the FigureWidget and iplot entry points involved in displaying it. Done means that changing fig.data[0].y and fig.layout.title updates the displayed chart with the new data and title.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.