Patthebug
Patthebug

Reputation: 4797

Modify axes range using plotly

I'm using the following code to generate a bubble plot using plotly:

Dataframe.iplot(kind='bubble', x='branch', y='retention', size='active_users', text='active_users',
             xTitle='', yTitle='Retention',
             filename='cufflinks/PlotName')

I'd like to set a manual range for Y axis. Any help would be appreciated.

Upvotes: 14

Views: 33973

Answers (2)

aerijman
aerijman

Reputation: 2782

A solution that works with subplots is:

fig.update_yaxes(range=[0, 0.4], row=1, col=1)

Upvotes: 20

Patthebug
Patthebug

Reputation: 4797

import plotly.graph_objs as go    
layout = go.Layout(
        yaxis=dict(
            range=[0, 0.4]
        )
    )

    Dataframe.iplot(kind='bubble', x='branch', y='retention', size='active_users', text='active_users',
                 xTitle='', yTitle='Retention',
                 filename='cufflinks/PlotName', layout = layout)

This will do the trick.

Upvotes: 14

Related Questions