text_html_output_1.png
from plotly.offline import init_notebook_mode, iplot

from plotly.plotly import iplot

import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import plotly.graph_objs as go

import seaborn as sns

data = pd.read_csv('../input/heart.csv', sep=',')
data = data.sort_values(by=['age'])
data['genderText'] = ['male' if 1 == each else 'female' for each in data.sex]

# corelation map
f, ax = plt.subplots(figsize=(18,18))
sns.heatmap(data.corr(),annot=True, linewidths=.5, fmt='.2f', ax=ax)

trace1 = go.Scatter(x=data.age, y=data.trestbps, mode='lines', name='trestbps', marker=dict(color='rgba(16, 112, 2, 0.8)'), text=data.genderText)
trace2 = go.Scatter(x=data.age, y=data.chol, mode='lines+markers', name='chol', marker=dict(color='rgba(80, 26, 80, 0.8)'), text=data.genderText)
data2 = [trace1, trace2]
layout = dict(title='trestbps and chol accoding to age', xaxis=dict(title='Age', ticklen=5, zeroline=False))
fig = dict(data=data2, layout=layout)
iplot(fig)