question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

go.Marker update problem

See original GitHub issue

Hi All,

When defined in a conditional statement, go.Marker fails to update marker attributes as described. To have a different color (than other markers in trace 3), I had to comment out the respective line.

if len(args) > 9:
        trace4 = go.Scatter(
                          x= args[9],
                          y= args[10],
                          mode='markers',
                          #marker=go.Marker(color='rgb(107,174,214)'),
                          xaxis='x1',
                          yaxis='y2',
                          name= 'Outliers',
                          text= args[11],
                          hoverinfo= 'all'
                          )
    else:
        trace4 = []

Am I not allowed to do such thing in the first place, or am I missing something?

Best, Agah

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
agahkarakuzucommented, Apr 6, 2018

@cldougl Thank you so much! Although brackets around args[] did not solved my issue, casting the trace data in the conditional statement similar to the remaining did the trick.

My take home message from this issue: Data type should be uniform among traces to be appended 😃

I wish us Montrealers a warm weekend (I guess this would be the best wish)!

0reactions
cldouglcommented, Apr 5, 2018

Thanks- I’m not able to run through that whole notebook (typically it’s easiest to determine the bug with a simplified example that’s based on dummy data rather than a user dataset).

Modifying the code you pasted above, you should be able to run:

import plotly.offline as off
import plotly.graph_objs as go

args = [0, 1, 2, 3, 4, 5]
args_T4 = [0, 1, 2, 3, 4, 5, 6, 7]

def generate_traces(args):
    trace0 = go.Scatter(x= [args[0]],
                        y= [args[1]],
                        mode='markers',
                        marker=go.Marker(color='blue', size=8))
    trace1 = go.Scatter(x= [args[2]],
                        y= [args[3]],
                        mode='markers',
                        marker=go.Marker(color='blue', size=8))
    trace2 = go.Scatter(x= [args[4]],
                        y= [args[5]],
                        mode='markers',
                        marker=go.Marker(color='blue', size=8))
    if len(args) > 6:
        trace3 = go.Scatter(x= [args[6]],
                            y= [args[7]],
                            mode='markers',
                            marker=go.Marker(color='pink', size=8))
    else:
        trace3 = {}
    
    data = [trace0, trace1, trace2, trace3]
    
    return data

data_T4 = generate_traces(args_T4)
off.plot(data_T4)

Here is a notebook comparing the 2 dummy datasets: https://plot.ly/~chelsea_lyn/16834

If you’re still having an issue with your example feel free to check out and post in our community forum!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to update chain markers · Issue #25679 - GitHub
Hi, any idea why this error occurs? can't seem to fully sync even after wiping storage and trying again.
Read more >
Change colorscale of marker with update menu (without ...
I have found the issue - it was actually a problem with the way I defined the restyle/update: when I use {'marker':{"colorscale":"Viridis"}} ...
Read more >
Roblox: How to Get Error Marker in Find the Markers
To get Error Marker in Find the Markers Roblox, you must use a computer in the abandoned house to get into another dimension....
Read more >
Inventory - Marker Update - SAP Community
The No Marker Update concept arises if the target InfoCube contains a non-cumulative key figure. For example, take the Material Movements ...
Read more >
Markers Are Not Showing on My Map on the Front-end
Please ensure that you are using the latest versions of all WP Go Maps plugins. To check to see whether you need to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found