PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, April 27, 2022

[FIXED] How to suppress graphviz warnings in Python 3?

 April 27, 2022     graphviz, python-3.x, warnings     No comments   

Issue

I'm using the graphviz module to render a network of nodes and links.

I use small circles as node's shape, so the labels are intentionally bigger than the nodes.

As a consequence, I get the following warning:

"Warning: node 'wave', graph 'N' size too small for label"

'Wave' is just an example of a node's label.

I get lots of this warnings because of the high quantity of nodes (screencapture).

So, my question is: How can I suppress warnings like those?

The graphviz command I'm using is:

n.view()  # n is my digraph

I have already tried the suggestions from:

How to suppress a third-party warning using warnings.filterwarnings

How to redirect python warnings to a custom stream?

But nothing so far. Thanks in advance.


Solution

Try Eli Bendersky's excellent page: Redirecting all kinds of stdout in Python

After replacing stdout with stderr, Eli's solution worked on graphviz for me.

If you happen to be using Evince, Ubuntu's builtin PDF viewer, see:

https://superuser.com/questions/980237/silence-evinces-warnings-in-ubuntu



Answered By - RemarkableBucket
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing