---
# System prepended metadata

title: attribute graphing

---

# attribute graphing


<h3>attribute</h3>

<ul>
<li>max ampltude</li>
<li>average ampltude</li>
<li>max slope (four points away)</li>
<li>percentage of peaks above the peaks' average ampltude</li>
<li>standard diviation</li>
<li><b>situation</b></li>
</ul>

<h3>code</h3>

``` python=
import plotly.express as px

def plotScatter(data, dimentionName, situationPos =-1):
    df =dict()
    
    df["situation"] =[]
    for dim in dimentionName:
        df[dim] =[]

    #print(df)
    
    for point in data:
        df["situation"].append(point[situationPos])

        co =0
        
        for dim in dimentionName:
            if co == situationPos or co == len(point)-situationPos:
                co +=1
            
            df[dim].append(point[co])
            co +=1

    fig =px.scatter_matrix(df, dimensions =dimentionName, color ="situation")

    fig.show()


'''
if __name__ == "__main__":
    testData =[]
    for i in range(5):
        testData.append((i, 2*i, i*i, abs((i-4)*i*(i-3)), "run"))
    for i in range(5, 10):
        testData.append((2*i, abs((i-4)*i*(i-3)), i*i, i, "walk"))
    for i in range(10, 15):
        testData.append((abs((i-4)*i*(i-3)), 2*i, i, i*i, "fall"))
        
    plotScatter(data =testData, dimentionName =["one", "two", "three", "four"], situationPos =-1)
'''

```

<h3>result</h3>

<img src ="https://i.imgur.com/7xFFljb.png" style ="margin: 0 auto;">
