Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Multiple Scatter Plots
- from plotly import tools
- trace1 = go.Scatter(x=df_sts.MedianListingPrice_1Bedroom,
- y=df_sts.MedianListingPrice_2Bedroom, mode='markers',
- name = "1Bedroom&2Bedroom", marker = dict(
- color = 'rgb(102,255,255)'))
- trace2 = go.Scatter(x=df_sts.MedianListingPrice_2Bedroom,
- y=df_sts.MedianListingPrice_3Bedroom, mode='markers',
- name = "2Bedroom&3Bedroom", marker = dict(
- color = 'rgb(102,178,255)'))
- trace3 = go.Scatter( x=df_sts.MedianListingPrice_3Bedroom,
- y=df_sts.MedianListingPrice_4Bedroom, mode='markers',
- name = "3Bedroom&4Bedroom", marker = dict(
- color = 'rgb(102,102,255)'))
- trace4 = go.Scatter(x=df_sts.MedianListingPrice_4Bedroom,
- y=df_sts.MedianListingPrice_5BedroomOrMore, mode='markers',
- name = "4Bedroom&5+Bedroom", marker = dict(
- color = 'rgb(178, 102, 255)'))
- fig = tools.make_subplots(rows=2, cols=2, subplot_titles=("1Bedroom & 2Bedroom", "2Bedroom & 3Bedroom",
- "3Bedroom&4Bedroom", "4Bedroom&5+Bedroom"))
- fig.append_trace(trace1, 1, 1)
- fig.append_trace(trace2, 1, 2)
- fig.append_trace(trace3, 2, 1)
- fig.append_trace(trace4, 2, 2)
- fig['layout']['xaxis3'].update(title='Median Listing Price')#showgrid=False
- fig['layout']['xaxis4'].update(title='Median Listing Price')
- fig['layout']['yaxis1'].update(title='Median Listing Price')
- fig['layout']['yaxis3'].update(title='Median Listing Price')
- fig['layout'].update(height=600, width=600, title='Mutiple Scatter Plots: Median Listing Price of' +
- ' Bedrooms')
- url = py.plot(fig, validate=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement