posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.76k stars 82 forks source link

Interactive matplotlib plots #4173

Closed seeM closed 3 months ago

seeM commented 3 months ago

We should support matplotlib's interactive mode i.e. ipympl.

For example, this should produce an interactive plot:

%matplotlib ipympl
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots()

x = np.linspace(0, 2*np.pi, 100)
y = np.sin(3*x)
ax.plot(x, y)

Currently it produces a static low-res plot:

image

Sub-issue of https://github.com/posit-dev/positron/issues/1924.

testlabauto commented 3 months ago

Verified Fixed

Positron Version(s) : 2024.08.0-24
OS Version          : OSX

Test scenario(s)

Console run of:

this works in the console

run this first in the console:

%matplotlib ipympl

import matplotlib.pyplot as plt import numpy as np

fig, ax = plt.subplots()

x = np.linspace(0, 2np.pi, 100) y = np.sin(3x) ax.plot(x, y)

Link(s) to TestRail test cases run or created: N/A