I would like to make a plot in python with jitter and size as variable.
I can either do a plot with size as variable (plt.scatter
) or jitter (sns.stripplot
)
Sample data (of course my real data is much bigger)
import pandas as pd
Test = pd.DataFrame(data = {'x': [3, 3, 3, 4], \
's' : [1, 4, 9, 20], \
't' : ["A", "B","A", "B"]})
plot with no jitter but size as variable
#Method 1 - no jitter
import matplotlib.pyplot as plt
x = Test['x']
s = Test['s']
t = Test['t']
plt.scatter(x = x, y = t, s = s* 100)
plot with jitter but no size distention
#Method 2 - no size
import seaborn as sns
sns.stripplot(x='x', y='t', size = 10, data= Test, jitter=True)