1

How do I fix or suppress the warning from the following code:

from matplotlib import pyplot as plt
import warnings
warnings.filterwarnings('ignore')

plt.clf()

Output:

(__main__.py:188073): Gtk-WARNING **: 19:37:54.366: Theme parsing error: gtk.css:3408:30: The style property GtkButton:image-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

Numerous StackOverflow answers say to use the warnings library, which I have applied as broadly as possible in the code without success. This is just a small example code. I make plt calls throughout my main code, so I'm looking for some broad suppression.

I'm using Matplotlib 3.1.1 on CentOS 7.6.

proximous
  • 617
  • 1
  • 10
  • 28
  • can you try updating matplotlib? You can also supress `Gtk-WARNING`s with this post: https://askubuntu.com/questions/505594/how-to-stop-gedit-and-other-programs-from-outputting-gtk-warnings-and-the-like – Mason Caiby Sep 13 '19 at 20:05
  • @MasonCaiby At the moment, 3.1.1 is the current version of Matplotlib, and the link you reference contains solutions that don't really suppress the warning, but instead filter the standard output of either specific programs or all programs, neither of which seems ideal to me. – proximous Oct 07 '19 at 23:53
  • I just ran your code with matplotlib version 3.1.1 and did not get that warning. What version of GTK are you running? – Mason Caiby Oct 08 '19 at 01:46

0 Answers0