Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6980031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:57:43+00:00 2026-05-27T17:57:43+00:00

I have Networkx 1.6 and Matplotlib 1.1.0 on Windows this is my code: self.figure

  • 0

I have Networkx 1.6 and Matplotlib 1.1.0 on Windows this is my code:

self.figure = Figure()
self.axes = self.figure.add_subplot(1,1,1)
self.canvas = FigureCanvas(self, -1, self.figure)
G = nx.Graph()
G.add_node(6)
pos = nx.spring_layout(G)
nx.draw(G, pos, ax = self.axes)

And I get the error:

File "C:\Python27\lib\site-packages\matplotlib\axes.py, line 1374, in _sci
"Argument must be an image, collection, or ContourSet in this Axes"
ValueError: Argument must be an image, collection, or ContourSet in this Axes

Does Anyone know how to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:57:44+00:00Added an answer on May 27, 2026 at 5:57 pm

    I am not sure what you want to draw exactly but you get a plot of your node doing:

        self.figure = Figure()
        self.axe = self.figure.add_subplot(1,1,1)
        G = nx.Graph()
        G.add_node(6)
        pos = nx.spring_layout(G)
        nx.draw(G, pos)
        pyplot.show()
    

    Thus, removing the apparently correct ax parameter allows drawing the figure. I found a post here showing the same error related to the ax parameter. It seems it was working on mpl 0.99 but not in mpl 1.0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on some code for a directed graph in NetworkX, and have hit
I have a networkx graph. I am adding nodes by adding edges G.add_edge(route[i-1],route[i]); Now
I have this program to draw a labelled edge with the nodes using matplotlib
I need the edge end points from a graph. I have installed networkx. I
I have Directed Graph in networkx. I want to only keep those nodes which
I have a networkx graph which contains nodes whose positions in the graph are
I have a network C++ program in Windows that I'd like to test for
I have 2 virtual networks, say 10.116.10.xxx and 10.116.11.xxx. I have the following code
It's taking me up to an hour to read a 1-gigabyte NetworkX graph data
Using Python's Networkx library, I created an undirected graph to represent a relationship network

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.