Skip to content

Instantly share code, notes, and snippets.

@LinuxIsCool
Created March 24, 2024 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LinuxIsCool/2b171a21e49b38b83251d3372c85ec4c to your computer and use it in GitHub Desktop.
Save LinuxIsCool/2b171a21e49b38b83251d3372c85ec4c to your computer and use it in GitHub Desktop.
Testing Python Panel Param Hvplot Interactive Plotting
import param as pm
import panel as pn
import hvplot.pandas
import pandas as pd
import numpy as np
pn.extension()
class Test(pm.Parameterized):
y = pm.Number(10, bounds=(0,20))
def view(self):
xs = np.linspace(0,1,100)
ys = [self.y for x in xs]
df = pd.DataFrame({'x':xs,'y':ys})
return df.hvplot(x='x',y='y')
t = Test()
pn.Row(t, t.view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment