Created
March 24, 2024 00:28
-
-
Save LinuxIsCool/2b171a21e49b38b83251d3372c85ec4c to your computer and use it in GitHub Desktop.
Testing Python Panel Param Hvplot Interactive Plotting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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