Skip to content

Releases: mpl-extensions/mpl-interactions

0.21.0

18 Apr 18:58
1b17042
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.20.2...0.21.0

0.20.2

17 Mar 19:18
62887ca
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.20.1...0.20.2

0.20.1

25 Jan 20:49
0517177
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.20.0...0.20.1

0.20.0

18 Dec 06:14
4d74ca9
Compare
Choose a tag to compare

What's Changed

  • Allow using controls as context by @ianhi in #223
  • Allow latest ipywidgets + test them by @ianhi in #225

Thanks to @samwelborn for askign about ipywidgets 8

Full Changelog: 0.19.0...0.20.0

0.19.0

15 Sep 20:37
519c292
Compare
Choose a tag to compare

Enable all kwargs for heatmap_slicer: #220

bigger v bump because order of args changed.

0.18.1

08 Sep 00:57
da7465b
Compare
Choose a tag to compare

Big changes to docs thanks to @redeboer in #203 #208 #209

Test improvements:
#212 (also @redeboer)

Bugs:
Fixed issue with turning scalars into 1D numpy arrays (#214 ) #216

Build:

Swapped to setuptools_scm #217 (hopefully this works 🤞 )

0.18.0

22 Jul 19:37
a4829c9
Compare
Choose a tag to compare

User facing improvements:
#207 - Allow image segmenter to embedded in a GUI + allow specifying the buttons for the panning and for the lasso.

Embed image-segmenter in PySimpleGUI example
import numpy as np
import PySimpleGUI as sg

"""
    Embedding the Matplotlib toolbar into your application
"""

from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.figure import Figure

from mpl_interactions import image_segmenter

# ------------------------------- PySimpleGUI CODE

layout = [
    [sg.T("Graph: y=sin(x)")],
    [sg.B("Toggle Erase Mode"), sg.B("Exit")],
    [sg.T("Controls:")],
    [sg.Canvas(key="controls_cv")],
    [sg.T("Figure:")],
    [
        sg.Column(
            layout=[
                [
                    sg.Canvas(
                        key="fig_cv",
                        # it's important that you set this size
                        size=(300, 800),
                    )
                ]
            ],
            background_color="#DAE0E6",
            pad=(0, 0),
        )
    ],
    [sg.B("Alive?")],
]

window = sg.Window("Graph with controls", layout)

# apply the layout so that the canvas exists for matplotlib to use.
window.finalize()

# Set up the Matplotlib Figure
DPI = 100
fig = Figure((200 * 2 / float(DPI), 800 / float(DPI)), dpi=DPI)
canvas = FigureCanvasTkAgg(fig, master=window["fig_cv"].TKCanvas)  # A tk.DrawingArea.

toolbar = NavigationToolbar2Tk(canvas, window["controls_cv"].TKCanvas)
toolbar.update()
fig.set_size_inches(404 * 2 / float(DPI), 404 / float(DPI))
canvas.draw()
canvas.get_tk_widget().pack(side="right", fill="both", expand=1)

# Set up matplotlib styling
# This won't change each loop
ax = fig.gca()
from imageio import imread

image = imread(
    "https://github.com/matplotlib/matplotlib/raw/v3.3.0/lib/matplotlib/mpl-data/sample_data/ada.png"
)
_ = ax.imshow(image)
segmenter = image_segmenter(image, ax=ax)


while True:
    event, values = window.read()
    print(event, values)
    if event in (sg.WIN_CLOSED, "Exit"):  # always,  always give a way out!
        break
    elif event == "Toggle Erase Mode":
        segmenter.erasing = not segmenter.erasing

window.close()
Thanks to @redeboer for several behind the scenes improvements:#203 #204

0.17.12

02 Jun 04:59
74966bc
Compare
Choose a tag to compare

Fixed scatter kwargs and include marker and facecolor #198. Thanks to @jrussell25 for finding the issue via marker and @kmdalton for facecolor

Also fixed black lint ci - thanks to @redeboer (more robust pre-commit to come!)

0.17.11

30 May 04:20
Compare
Choose a tag to compare

Fix Matplotlib range sliders - #195

0.17.10

27 May 21:13
ab06aa2
Compare
Choose a tag to compare

Improved the handling of scalar arguments: #194 which fixed #191 and #192