this is just a small problem that has been bugging me for a while.
I have a pandas dataframe consisting of all continuous variables. I want to draw a scatter plot (u
You may add plt.show()
at the end of your function. This replots the graph in the same cell instead of adding a new one.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from ipywidgets import interactive
%matplotlib inline
columns=['a','b','c']
data = np.cumsum(np.random.rand(10,3),axis=1)
df = pd.DataFrame(data,columns=columns)
def g(x,y):
plt.scatter(df[x], df[y])
plt.show()
interactive_plot = interactive(g, x=columns, y=columns)
interactive_plot