# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
# ---

# +
import matplotlib.pyplot as plt
import seaborn as sns

# built in dataset asnscombe
df = sns.load_dataset('anscombe')
#df.to_csv('anscombe.csv', index=False) # but save it for review

# 3 columns
df
# -

# matplot lib. not using sns yet
# we don't need lines but see the lines for feedback
# example plot
plt.plot(df.x, df.y)

# example plot but o for observation points.
# over all points in csv file, not broken down into data set groups
plt.plot(df.x, df.y, 'o') #better, we don't want lines

# There are 4 groups of data # group
s1 = df[df.dataset == 'I']
s2 = df[df.dataset == 'II']
s3 = df[df.dataset == 'III']
s4 = df[df.dataset == 'IV']

# +
# build a figure and for each dataset group in csv
# sub dataset col to show diff shape rather than all of it.
fig = plt.figure()
# figure with 2 rows and 2 columns, position of subplot
x1 = fig.add_subplot(2,2,1)
x2 = fig.add_subplot(2,2,2)
x3 = fig.add_subplot(2,2,3)
x4 = fig.add_subplot(2,2,4)

# for each subplot plot o points for each independent series extracted as groups. 
# each subplot tells its own distinct story
x1.plot(s1.x, s1.y, 'o')
x2.plot(s2.x, s2.y, 'o')
x3.plot(s3.x, s3.y, 'o')
x4.plot(s4.x, s4.y, 'o')

# motivating example why to visualize the segmented
# -



StarcoderdataJupyterScriptsDedupFiltered