Skip to content

Remove backend and add resolve nteract: matplotlib.use('nbagg') #32

Open
@hasibzunair

Description

@hasibzunair

Backend is no longer necessary IMO. Using a backend results in the following error on Jupyter.

Javascript Error: IPython is not defined

Also adding %matplotlib inline before importing matplotlib resolves the displaying of graphs.

Should I fix them in the notebooks and send a PR?

Thanks.

Activity

tacaswell

tacaswell commented on Oct 27, 2019

@tacaswell
Member

Switching to inline means none of the interactive examples will work. To get them to work under jupyterlab (rather than the classic notebooks) the magics should be switched to %matplotlib widget and the install instruction should be updated to make sure ipympl is installed (on both the js and python sides).

changed the title [-][REQUEST for MERGE]Remove backend: matplotlib.use('nbagg')[/-] [+]Remove backend and add resolve nteract: matplotlib.use('nbagg')[/+] on Oct 27, 2019
hasibzunair

hasibzunair commented on Oct 27, 2019

@hasibzunair
Author

I am able to run all examples by switching to inline and removing backend at the same time. Also %matplotlib widget, after installing ipympl, results in the following error in the Test Install.ipynb.

Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …

I am using Python 3.6.8.

tacaswell

tacaswell commented on Oct 27, 2019

@tacaswell
Member

I believe you have to restart your server after installing ipympl. One of the strenghts of Matplotlib is that it is interactive (you can pan / zoom, add lines iteratively etc). Switching to the inline backend throws all of that out and replaces the plots to static png that must be generated all in one cell so I am very reluctant to change the tutorial to be based on 'inline'.

hasibzunair

hasibzunair commented on Oct 27, 2019

@hasibzunair
Author

I already restarted after installing it. Still results in the same error. Additionally, running the cell more than once results in another error:

KeyError: '97acd0c8fb504a2288834b349003b4ae'

tacaswell

tacaswell commented on Oct 27, 2019

@tacaswell
Member

That still sounds like installation issues. Can you open an issue with https://github.com/matplotlib/jupyter-matplotlib ?

hasibzunair

hasibzunair commented on Oct 27, 2019

@hasibzunair
Author

You can find the issue at #148. Any workarounds for the backend issue? Not sure if this matplotlib.use('nbagg') is needed anymore.

tacaswell

tacaswell commented on Oct 27, 2019

@tacaswell
Member

As I said above, we need to update the notebooks and install instructions to work with ipypmpl rather than nbagg.

hasibzunair

hasibzunair commented on Oct 27, 2019

@hasibzunair
Author

Requesting a review for #33

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tacaswell@hasibzunair

        Issue actions

          Remove backend and add resolve nteract: matplotlib.use('nbagg') · Issue #32 · matplotlib/AnatomyOfMatplotlib