Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoscale yaxis when xaxis range specified #2432

Closed
bluprince13 opened this issue Mar 2, 2018 · 2 comments
Closed

Autoscale yaxis when xaxis range specified #2432

bluprince13 opened this issue Mar 2, 2018 · 2 comments

Comments

@bluprince13
Copy link

bluprince13 commented Mar 2, 2018

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')
@alexcjohnson
Copy link
Collaborator

I guess what you mean is can we autoscale the y axis to the data that's visible given the x axis range? That's a feature we've been discussing here #1876 (comment)

@etpinard
Copy link
Contributor

etpinard commented Mar 2, 2018

Merging with #1876

@etpinard etpinard closed this as completed Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants