Skip to content

importing napari-matplotlib modifies how plots are shown in jupyter notebooks #64

Closed
@haesleinhuepf

Description

@haesleinhuepf

... and it should not.

The visualization of plots in matplotlib change after napari_matplotlib has been imported. Global settings e.g. here should not be modified by a napari-plugin. Consider programming napari-plugins side-effect free.

image

To reproduce:

import matplotlib.pyplot as plt
import numpy as np

image = np.random.random((3,3))
plt.imshow(image)
import napari_matplotlib
plt.imshow(image)

The same can be observed when not importing napari_matplotlib but instead opening a viewer where napari-stress is installed, because starting the viewer imports napari_stress and this imports napari_matplotlib in the background. A napari-plugin should not modify how things are displayed in jupyter notebooks. It's kind of evil usage of global variables.

CC @jo-mueller

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions