Skip to content

Autoscale yaxis when xaxis range specified #2432

@bluprince13

Description

@bluprince13

Using the example code below, a plot is generated (which you can see here). I have specified the xaxis range, but the yaxis doesn't autoscale in response. Is there any way to force the yaxis to autoscale?

import plotly.offline as py
import plotly.graph_objs as go

trace1 = go.Scatter(
    x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
    y=[8, 7, 6, 5, 4, 3, 2, 1, 0]
)
trace2 = go.Scatter(
    x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
    y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
)
data = [trace1, trace2]
layout = go.Layout(
    xaxis=dict(
        range=[2, 5]
    ),

)
fig = go.Figure(data=data, layout=layout)
py.plot(fig, filename='axes-range-manual')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions