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

Error in update graph for Tutorial #5

Open
dredvard opened this issue Aug 30, 2018 · 0 comments
Open

Error in update graph for Tutorial #5

dredvard opened this issue Aug 30, 2018 · 0 comments

Comments

@dredvard
Copy link

The code xref =""x" not "y". Should be updated to the following:

def update_graph(x_val, y_val):
traces = [go.Heatmap(z=_simple_image(x_val, y_val, as_uri = False),
#colorscale='Viridis'
)]
if (x_val>0) or (y_val>0):
traces += [go.Scatter(x = [x_val], y = [y_val])]

layout = go.Layout(
    #images= [_simple_image(x_val,y_val)],
    annotations=[
    dict(                            # all "annotation" attributes: /python/reference/#layout-annotations
        text="Current Position ({}, {})".format(x_val, y_val),    # /python/reference/#layout-annotations-text
        x=x_val,                         # /python/reference/#layout-annotations-x
        xref="x",                # /python/reference/#layout-annotations-xref
        y=y_val,                         # /python/reference/#layout-annotations-y
        yref="y"                 # /python/reference/#layout-annotations-yref
    )
]
                  )
return dict(data = traces, layout=layout)
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

1 participant