Skip to content

TypeError: '_AxesStack' object is not callable #21

@kpennell

Description

@kpennell

I'm getting TypeError: '_AxesStack' object is not callable when I run

# Try the following: 
# plot a single directed graph the email at index 3
plot_single_directed(reader,3)

# plot a single undirected graph the email at index 3, show title in plot
plot_single_undirected(reader, 1, showtitle=True)

# plot a directed graph, optionally specifying a layout style
plot_directed(reader)
plot_directed(reader, 'shell')
# optionally export a .graphml to your working directory for use
# in other network / graphing software
plot_undirected(reader, 'spring', graphml=True)

Versions

  • NetworkX: 2.8.4
  • Matplotlib: 3.7.1
  • Python: 3.11.3

Steps to Reproduce

  1. Create new Python 3.11 environment
  2. Install latest NetworkX and Matplotlib and emailnetwork
  3. Run sample code

Error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[28], line 3
      1 # Try the following: 
      2 # plot a single directed graph the email at index 3
----> 3 plot_single_directed(reader,3)
      5 # plot a single undirected graph the email at index 3, show title in plot
      6 plot_single_undirected(reader, 1, showtitle=True)

File ~/anaconda3/lib/python3.11/site-packages/emailnetwork/graph.py:58, in plot_single_directed(reader, id, showtitle)
     56 # nx.draw_spectral(G,node_size=0, alpha=0.8, edge_color=colors, width=list(weights), font_size=8, with_labels=True)
     57 nx.draw_networkx_edge_labels(G, pos, edge_labels=edge_labels, font_size=6, label_pos=0.5)
---> 58 nx.draw_planar(G,node_size=0, alpha=1, edge_color=colors, width=list(weights), font_size=8, font_weight='bold', with_labels=True, verticalalignment='bottom')
     60 if showtitle:
     61     font = {"fontname": "Helvetica", "color": "k", "fontweight": "bold", "fontsize": 8}

File ~/anaconda3/lib/python3.11/site-packages/networkx/drawing/nx_pylab.py:1440, in draw_planar(G, **kwargs)
   1404 def draw_planar(G, **kwargs):
   1405     """Draw a planar networkx graph `G` with planar layout.
   1406 
   1407     This is a convenience function equivalent to::
   (...)
   1438     :func:`~networkx.drawing.layout.planar_layout`
   1439     """
-> 1440     draw(G, planar_layout(G), **kwargs)

File ~/anaconda3/lib/python3.11/site-packages/networkx/drawing/nx_pylab.py:113, in draw(G, pos, ax, **kwds)
    111 cf.set_facecolor("w")
    112 if ax is None:
--> 113     if cf._axstack() is None:
    114         ax = cf.add_axes((0, 0, 1, 1))
    115     else:

TypeError: '_AxesStack' object is not callable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions