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.
To change the range of X and Y axes, we can use xlim() and ylim() methods.
One of the best ways to modify the size of the Plotly figure is by adjusting the width and the height parameters. We will start by discussing how to change the height and width parameters using Plotly Express. For example, in the following code, we create a simple line chart using the default Plotly's dimensions.
Note: At this time, Plotly Express does not support multiple Y axes on a single figure. To make such a figure, use the make_subplots() function in conjunction with graph objects as documented below.
To change the axis scales on a plot in base R Language, we can use the xlim() and ylim() functions. The xlim() and ylim() functions are convenience functions that set the limit of the x-axis and y-axis respectively.
A solution that works with subplots is:
fig.update_yaxes(range=[0, 0.4], row=1, col=1)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With