Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

3D Network Graphs Example Not Working

Hi all,

Apologies all as I’m kind of new to Python however I’m interested in trying to get the examples working for Plotly to understand how it works. I’m having some difficulty getting the 3D Network Graph working (https://plot.ly/python/3d-network-graph/).

The whole thing fires correctly however I receive the the error

Traceback (most recent call last):
File "3d-graph-test.py", line 129, in <module>
size=14
TypeError: __init__() got an unexpected keyword argument 'showlegend'

I copied the code on the above link however it appears to be specifically referring to this section:

layout = Layout(
         title="Network of coappearances of characters in Victor Hugo's novel<br> Les Miserables (3D visualization)",
         width=1000,
         height=1000,
         showlegend=False,
         scene=Scene(
         xaxis=XAxis(axis),
         yaxis=YAxis(axis),
         zaxis=ZAxis(axis),
        ),
     margin=Margin(
        t=100
    ),
    hovermode='closest',
    annotations=Annotations([
           Annotation(
           showarrow=False,
            text="Data source: <a href='http://bost.ocks.org/mike/miserables/miserables.json'>[1] miserables.json</a>",
            xref='paper',
            yref='paper',
            x=0,
            y=0.1,
            xanchor='left',
            yanchor='bottom',
            font=Font(
            size=14
            )
            )
        ]),    )

Any ideas? Apologies in advance if this is super obvious.

Kind regards

@Dudibob I downloaded a few minutes ago the notebook at the link you posted, ran it, and no error was displayed, and the graph is fine. (Plotly version 2.2.1).

Hi Empet,

Thank you for the reply, just ran it on my home computer and had no issues running it, not sure why my work computer wasn’t happy with it.