Mpl-interactions

Latest version: v0.24.2

Safety actively analyzes 682404 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 8

0.20.1

What's Changed
* docs: add samwelborn as a contributor for userTesting by allcontributors in https://github.com/ianhi/mpl-interactions/pull/226
* Deprecate `ioff` in favor of `plt.ioff()` by ianhi in https://github.com/ianhi/mpl-interactions/pull/230
* Don't fail on sca by ianhi in https://github.com/ianhi/mpl-interactions/pull/233


**Full Changelog**: https://github.com/ianhi/mpl-interactions/compare/0.20.0...0.20.1

0.20.0

What's Changed
* Allow using controls as context by ianhi in https://github.com/ianhi/mpl-interactions/pull/223
* Allow latest ipywidgets + test them by ianhi in https://github.com/ianhi/mpl-interactions/pull/225

Thanks to samwelborn for askign about ipywidgets 8

**Full Changelog**: https://github.com/ianhi/mpl-interactions/compare/0.19.0...0.20.0

0.19.0

Enable all kwargs for `heatmap_slicer`: https://github.com/ianhi/mpl-interactions/pull/220

bigger v bump because order of args changed.

0.18.1

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 :crossed_fingers: )

0.18.0

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


<details>
<summary>Embed image-segmenter in PySimpleGUI example</summary>

python
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()



</details>
Thanks to redeboer for several behind the scenes improvements:203 204

0.17.12

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!)

Page 3 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.