2

I am trying to plot a dendrogram using plotly. I used the code given below:

import plotly.plotly as py
import plotly.figure_factory as ff

names = list(result_data['merchant_id'])

dendro = ff.create_dendrogram(new_data,labels=names)
dendro['layout'].update({'width':1400, 'height':600})
plotly.offline.iplot(dendro, filename='simple_dendrogram')

and I got the plot : enter image description here

How I can Assign title, x label and y label in above plot?

1 Answer 1

2

You can just update the layout with the required settings, Refer the below example.

Code:

import plotly.plotly as py
import plotly.figure_factory as ff

names = list(result_data['merchant_id'])

dendro = ff.create_dendrogram(new_data,labels=names)
dendro['layout'].update({'width':1400, 'height':600, 'title': 'this is the title', 
                    'xaxis': {'title': 'xaxis label'}, 'yaxis': {'title': 'yaxis label'}})
plotly.offline.iplot(dendro, filename='simple_dendrogram')
Sign up to request clarification or add additional context in comments.

1 Comment

@neha does this help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.