From jonnojohnson at gmail.com Fri Nov 3 14:04:06 2017 From: jonnojohnson at gmail.com (Jonno) Date: Fri, 3 Nov 2017 13:04:06 -0500 Subject: [Matplotlib-users] Update data (Polycollection) in fill_between() Message-ID: For axes.line2D objects there is set_data(), for axes.fill objects there is set_xy(). What is the closest equivalent for fill_between objects which are PolyCollections? Thanks, Jonno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Fri Nov 3 14:07:49 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Fri, 3 Nov 2017 11:07:49 -0700 Subject: [Matplotlib-users] Update data (Polycollection) in fill_between() In-Reply-To: References: Message-ID: <20C0D250-C3BF-47A6-B3C2-3E44AE45DB80@uvic.ca> > On 3 Nov 2017, at 11:04 AM, Jonno wrote: > > For axes.line2D objects there is set_data(), for axes.fill objects there is set_xy(). What is the closest equivalent for fill_between objects which are PolyCollections? Not sure, but its not `set_verts`? Cheers, Jody > > Thanks, > > Jonno. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -- Jody Klymak http://web.uvic.ca/~jklymak/ From formisc at gmail.com Sat Nov 4 11:09:25 2017 From: formisc at gmail.com (Andrew Z) Date: Sat, 4 Nov 2017 11:09:25 -0400 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? Message-ID: hello, the issue i'm experiencing is local to my laptop ( the other machines i have run examples just fine). I described it here https://www.mail-archive.com/python-list at python.org/msg432343.html in details. i searched around, but none of the proposed workarounds helped. Is there a way to enable some-kind of debugging or verbose output to see what exactly is happening behind the scene? Thank you. AZ -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Sat Nov 4 15:35:41 2017 From: formisc at gmail.com (Andrew Z) Date: Sat, 4 Nov 2017 15:35:41 -0400 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: more relevant information: [az at hp src]$ python3.5 Python 3.5.3 (default, May 11 2017, 09:10:41) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.__file__ '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >>> matplotlib.get_configdir() '/home/az/.config/matplotlib' >>> print(matplotlib.__version__) 2.1.0 now if i get the simplest plot : [az at hp src]$ more ./main1.py import matplotlib.pyplot as plt print("imported") plt.plot([1,2,4,1]) print("plot is done") plt.show() print("show is done") [az at hp src]$ python3.5 main1.py --verbose-debug $HOME=/home/az matplotlib data path /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data loaded rc file /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 2.1.0 verbose.level debug interactive is False platform is linux loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', 'selectors', 'numpy.core', 'json.encoder', 'operator', 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', '_random', 'email.iterators', '_collections_abc', '__future__', 'email', 'numpy._distributor_init', 'unittest.loader', '_bootlocale', 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', 'locale', 'email.errors', 'numpy.core.numerictypes', 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', 'unittest.result', 're', 'http.client', 'numpy.lib.info', 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', 'builtins'] CACHEDIR=/home/az/.cache/matplotlib Using fontManager instance from /home/az/.cache/matplotlib/fontList.json backend TkAgg version 8.6 imported ^C Hangs at this point with CPU @ 100% grep -v '#' /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc The only line is : backend : TkAgg [az at hp src]$ gcc --version gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) I installed using pip3 into --user directory. but i also remember that i used dnf to get tkInnter installed: rpm -qa | grep tkin python3-tkinter-3.5.3-6.fc24.x86_64 tkinter-2.7.13-2.fc24.x86_64 tix-1:8.4.3-17.fc24.x86_64 if i were to compare "pip3 list" between system (root) and the user (az): diff -u /tmp/root_pip /tmp/usr_pip --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 @@ -1,39 +1,65 @@ astroid (1.4.5) beautifulsoup4 (4.6.0) +bleach (2.1) blivet (1.20.3) chardet (2.2.1) coverage (4.4.1) cssselect (0.9.1) cupshelpers (1.0) +cx-Oracle (6.0.2) cycler (0.10.0) decorator (4.0.11) distro (1.0.2) dnf-langpacks (0.15.1) +entrypoints (0.2.3) fros (1.1) -html5lib (0.999) +html5lib (1.0b10) humanize (0.5.1) ib-insync (0.8.5) +ibapi (9.73.2) iniparse (0.4) initial-setup (0.3.40) IPy (0.81) +ipykernel (4.6.1) +ipython (6.2.0) +ipython-genutils (0.2.0) ipywidgets (7.0.0) isc (1.0) javapackages (4.6.0) +jedi (0.11.0) +Jinja2 (2.9.6) +jsonschema (2.6.0) jupyter (1.0.0) +jupyter-client (5.1.0) +jupyter-console (5.2.0) +jupyter-core (4.3.0) langtable (0.0.35) lazy-object-proxy (1.2.1) lxml (3.7.2) +MarkupSafe (1.0) +matplotlib (2.1.0) +mistune (0.7.4) +nbconvert (5.3.1) +nbformat (4.4.0) +notebook (5.1.0) ntplib (0.3.3) numpy (1.13.3) ordered-set (2.0.0) pandas (0.20.3) +pandocfilters (1.4.2) +parso (0.1.0) +pexpect (4.2.1) +pickleshare (0.7.4) pid (2.0.1) Pillow (3.2.0) pip (9.0.1) +prompt-toolkit (1.0.15) +ptyprocess (0.5.2) pwquality (1.3.0) pycups (1.9.72) pycurl (7.43.0) pyenchant (1.6.8) +Pygments (2.2.0) pygobject (3.20.1) pygpgme (0.3) pyinotify (0.9.6) @@ -42,6 +68,7 @@ pylint (1.5.6) pyparsing (2.2.0) pyparted (3.10.7) +PyQt5 (5.9) PySocks (1.5.6) python-augeas (0.5.0) python-dateutil (2.6.1) @@ -50,6 +77,9 @@ pytz (2017.2) pyudev (0.21.0) pyxdg (0.25) +pyzmq (16.0.2) +qtconsole (4.3.1) +Quamash (0.5.5) requests (2.10.0) requests-file (1.4) requests-ftp (0.3.1) @@ -60,11 +90,21 @@ sepolicy (1.1) setroubleshoot (1.1) setuptools (20.1.1) +simplegeneric (0.8.1) +sip (4.19.3) six (1.11.0) slip (0.6.4) slip.dbus (0.6.4) sos (3.2) SSSDConfig (1.15.3) systemd-python (232) +terminado (0.6) +testpath (0.3.1) +tornado (4.5.2) +traitlets (4.3.2) +tws-async (0.5.5) urllib3 (1.15.1) +wcwidth (0.1.7) +webencodings (0.5.1) +widgetsnbextension (3.0.3) wrapt (1.10.10) I just removed html5lib from system(root) , but tha made no difference to the plotting.. On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: > hello, > the issue i'm experiencing is local to my laptop ( the other machines i > have run examples just fine). > I described it here https://www.mail-archive.com/python-list at python.org/ > msg432343.html in details. > i searched around, but none of the proposed workarounds helped. > > Is there a way to enable some-kind of debugging or verbose output to see > what exactly is happening behind the scene? > > Thank you. > AZ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jse.mnl at gmail.com Sun Nov 5 18:14:24 2017 From: jse.mnl at gmail.com (Jose Manuel) Date: Sun, 5 Nov 2017 18:14:24 -0500 Subject: [Matplotlib-users] Ticks no showing url in svg Message-ID: I am trying to extend the example in https://github.com/matplotlib/matplotlib/blob/master/examples/misc/hyperlinks_sgskip.py to deal with hyperlinks in the ticks, but I am failing miserabily. My test code for matplotlib 2.1.0 is: import matplotlib as mpl mpl.use('SVG') import matplotlib.pyplot as plt f = plt.figure() ax = f.gca() s = plt.scatter([1, 2, 3], [4, 5, 6]) s.set_urls(['http://www.bbc.co.uk/news', 'http://www.google.com', None]) for tick, pos, label in ax.yaxis.iter_ticks(): tick.set_url('http://www.python.org') print(tick.get_url(), pos, label) f.savefig('scatter.svg') I get: http://www.python.org 3.75 3.75 http://www.python.org 4.0 4.00 http://www.python.org 4.25 4.25 ..... http://www.python.org 6.25 6.25 But, the svg file generated has nothing of the ticks links: > grep python scatter.svg ...while it does for the scatter plot links, for instance: > egrep google scatter.svg Am I missing something to make this work? Many thanks in advance for any hint! Jose From ben.v.root at gmail.com Mon Nov 6 15:13:11 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 6 Nov 2017 15:13:11 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: How did you install Tkinter? Have you tested any other backends? Does this happen for just the head-less "Agg" backend set as default? On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: > more relevant information: > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib > >>> matplotlib.__file__ > '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' > >>> matplotlib.get_configdir() > '/home/az/.config/matplotlib' > >>> print(matplotlib.__version__) > 2.1.0 > > now if i get the simplest plot : > > [az at hp src]$ more ./main1.py > import matplotlib.pyplot as plt > print("imported") > plt.plot([1,2,4,1]) > print("plot is done") > plt.show() > print("show is done") > > [az at hp src]$ python3.5 main1.py --verbose-debug > $HOME=/home/az > matplotlib data path /home/az/.local/lib/python3.5/ > site-packages/matplotlib/mpl-data > loaded rc file /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl- > data/matplotlibrc > matplotlib version 2.1.0 > verbose.level debug > interactive is False > platform is linux > loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', > 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', > 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', > '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', > 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', > 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', > 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', > 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', > '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', > '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', > 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', > 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', > 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' > numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', > 'encodings.cp437', 'numpy.polynomial.polynomial', > 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', > 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', > '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', > 'selectors', 'numpy.core', 'json.encoder', 'operator', > 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', > 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', > 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', > 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', > 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', > 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', > 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', > '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', > 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', > 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', > 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', > 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' > numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', > 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', > 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', > 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', > 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', > 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', > 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', > 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', > 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', > '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', > 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', > '_random', 'email.iterators', '_collections_abc', '__future__', 'email', > 'numpy._distributor_init', 'unittest.loader', '_bootlocale', > 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', > 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', > 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', > 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', > 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', > 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', > 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', > 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', > 'locale', 'email.errors', 'numpy.core.numerictypes', > 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', > 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', > 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', > 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', > 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', > 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', > 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', > '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', > 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', > 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', > 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', > 'unittest.result', 're', 'http.client', 'numpy.lib.info', > 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', > 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', > 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', > 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', > 'builtins'] > CACHEDIR=/home/az/.cache/matplotlib > Using fontManager instance from /home/az/.cache/matplotlib/fontList.json > backend TkAgg version 8.6 > imported > ^C > Hangs at this point with CPU @ 100% > > grep -v '#' /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl- > data/matplotlibrc > > The only line is : > backend : TkAgg > > > [az at hp src]$ gcc --version > gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) > > I installed using pip3 into --user directory. > but i also remember that i used dnf to get tkInnter installed: > rpm -qa | grep tkin > python3-tkinter-3.5.3-6.fc24.x86_64 > tkinter-2.7.13-2.fc24.x86_64 > tix-1:8.4.3-17.fc24.x86_64 > if i were to compare "pip3 list" between system (root) and the user (az): > diff -u /tmp/root_pip /tmp/usr_pip > --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 > +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 > @@ -1,39 +1,65 @@ > astroid (1.4.5) > beautifulsoup4 (4.6.0) > +bleach (2.1) > blivet (1.20.3) > chardet (2.2.1) > coverage (4.4.1) > cssselect (0.9.1) > cupshelpers (1.0) > +cx-Oracle (6.0.2) > cycler (0.10.0) > decorator (4.0.11) > distro (1.0.2) > dnf-langpacks (0.15.1) > +entrypoints (0.2.3) > fros (1.1) > -html5lib (0.999) > +html5lib (1.0b10) > humanize (0.5.1) > ib-insync (0.8.5) > +ibapi (9.73.2) > iniparse (0.4) > initial-setup (0.3.40) > IPy (0.81) > +ipykernel (4.6.1) > +ipython (6.2.0) > +ipython-genutils (0.2.0) > ipywidgets (7.0.0) > isc (1.0) > javapackages (4.6.0) > +jedi (0.11.0) > +Jinja2 (2.9.6) > +jsonschema (2.6.0) > jupyter (1.0.0) > +jupyter-client (5.1.0) > +jupyter-console (5.2.0) > +jupyter-core (4.3.0) > langtable (0.0.35) > lazy-object-proxy (1.2.1) > lxml (3.7.2) > +MarkupSafe (1.0) > +matplotlib (2.1.0) > +mistune (0.7.4) > +nbconvert (5.3.1) > +nbformat (4.4.0) > +notebook (5.1.0) > ntplib (0.3.3) > numpy (1.13.3) > ordered-set (2.0.0) > pandas (0.20.3) > +pandocfilters (1.4.2) > +parso (0.1.0) > +pexpect (4.2.1) > +pickleshare (0.7.4) > pid (2.0.1) > Pillow (3.2.0) > pip (9.0.1) > +prompt-toolkit (1.0.15) > +ptyprocess (0.5.2) > pwquality (1.3.0) > pycups (1.9.72) > pycurl (7.43.0) > pyenchant (1.6.8) > +Pygments (2.2.0) > pygobject (3.20.1) > pygpgme (0.3) > pyinotify (0.9.6) > @@ -42,6 +68,7 @@ > pylint (1.5.6) > pyparsing (2.2.0) > pyparted (3.10.7) > +PyQt5 (5.9) > PySocks (1.5.6) > python-augeas (0.5.0) > python-dateutil (2.6.1) > @@ -50,6 +77,9 @@ > pytz (2017.2) > pyudev (0.21.0) > pyxdg (0.25) > +pyzmq (16.0.2) > +qtconsole (4.3.1) > +Quamash (0.5.5) > requests (2.10.0) > requests-file (1.4) > requests-ftp (0.3.1) > @@ -60,11 +90,21 @@ > sepolicy (1.1) > setroubleshoot (1.1) > setuptools (20.1.1) > +simplegeneric (0.8.1) > +sip (4.19.3) > six (1.11.0) > slip (0.6.4) > slip.dbus (0.6.4) > sos (3.2) > SSSDConfig (1.15.3) > systemd-python (232) > +terminado (0.6) > +testpath (0.3.1) > +tornado (4.5.2) > +traitlets (4.3.2) > +tws-async (0.5.5) > urllib3 (1.15.1) > +wcwidth (0.1.7) > +webencodings (0.5.1) > +widgetsnbextension (3.0.3) > wrapt (1.10.10) > > > I just removed html5lib from system(root) , but tha made no difference to > the plotting.. > > > > > > On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: > >> hello, >> the issue i'm experiencing is local to my laptop ( the other machines i >> have run examples just fine). >> I described it here https://www.mail-archive.com/p >> ython-list at python.org/msg432343.html in details. >> i searched around, but none of the proposed workarounds helped. >> >> Is there a way to enable some-kind of debugging or verbose output to see >> what exactly is happening behind the scene? >> >> Thank you. >> AZ >> >> > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Mon Nov 6 16:09:00 2017 From: formisc at gmail.com (Andrew Z) Date: Mon, 6 Nov 2017 16:09:00 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: Tkinter was most likely installed as part of rpm install. Backends - not really. I do know that with mpld3and agg the scripts hang. Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) and with pip3. Today i tried on the office machine (fedora 25). Rpm brings only matplot1.5. maybe 2 installed locally using pip3 messes with 1.5 leftover or libraries. Not sure how to validate this idea though.. Probably unrelated: In pycharm pyplot is not been recognized as part of matplotlib when i "import matplotlib.pyplot. yet the script doesnt crash on import statement... On Nov 6, 2017 15:13, "Benjamin Root" wrote: How did you install Tkinter? Have you tested any other backends? Does this happen for just the head-less "Agg" backend set as default? On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: > more relevant information: > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib > >>> matplotlib.__file__ > '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' > >>> matplotlib.get_configdir() > '/home/az/.config/matplotlib' > >>> print(matplotlib.__version__) > 2.1.0 > > now if i get the simplest plot : > > [az at hp src]$ more ./main1.py > import matplotlib.pyplot as plt > print("imported") > plt.plot([1,2,4,1]) > print("plot is done") > plt.show() > print("show is done") > > [az at hp src]$ python3.5 main1.py --verbose-debug > $HOME=/home/az > matplotlib data path /home/az/.local/lib/python3.5/ > site-packages/matplotlib/mpl-data > loaded rc file /home/az/.local/lib/python3.5/ > site-packages/matplotlib/mpl-data/matplotlibrc > matplotlib version 2.1.0 > verbose.level debug > interactive is False > platform is linux > loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', > 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', > 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', > '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', > 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', > 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', > 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', > 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', > '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', > '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', > 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', > 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', > 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' > numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', > 'encodings.cp437', 'numpy.polynomial.polynomial', > 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', > 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', > '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', > 'selectors', 'numpy.core', 'json.encoder', 'operator', > 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', > 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', > 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', > 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', > 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', > 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', > 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', > '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', > 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', > 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', > 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', > 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' > numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', > 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', > 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', > 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', > 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', > 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', > 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', > 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', > 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', > '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', > 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', > '_random', 'email.iterators', '_collections_abc', '__future__', 'email', > 'numpy._distributor_init', 'unittest.loader', '_bootlocale', > 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', > 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', > 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', > 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', > 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', > 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', > 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', > 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', > 'locale', 'email.errors', 'numpy.core.numerictypes', > 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', > 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', > 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', > 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', > 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', > 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', > 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', > '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', > 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', > 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', > 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', > 'unittest.result', 're', 'http.client', 'numpy.lib.info', > 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', > 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', > 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', > 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', > 'builtins'] > CACHEDIR=/home/az/.cache/matplotlib > Using fontManager instance from /home/az/.cache/matplotlib/fontList.json > backend TkAgg version 8.6 > imported > ^C > Hangs at this point with CPU @ 100% > > grep -v '#' /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-d > ata/matplotlibrc > > The only line is : > backend : TkAgg > > > [az at hp src]$ gcc --version > gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) > > I installed using pip3 into --user directory. > but i also remember that i used dnf to get tkInnter installed: > rpm -qa | grep tkin > python3-tkinter-3.5.3-6.fc24.x86_64 > tkinter-2.7.13-2.fc24.x86_64 > tix-1:8.4.3-17.fc24.x86_64 > if i were to compare "pip3 list" between system (root) and the user (az): > diff -u /tmp/root_pip /tmp/usr_pip > --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 > +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 > @@ -1,39 +1,65 @@ > astroid (1.4.5) > beautifulsoup4 (4.6.0) > +bleach (2.1) > blivet (1.20.3) > chardet (2.2.1) > coverage (4.4.1) > cssselect (0.9.1) > cupshelpers (1.0) > +cx-Oracle (6.0.2) > cycler (0.10.0) > decorator (4.0.11) > distro (1.0.2) > dnf-langpacks (0.15.1) > +entrypoints (0.2.3) > fros (1.1) > -html5lib (0.999) > +html5lib (1.0b10) > humanize (0.5.1) > ib-insync (0.8.5) > +ibapi (9.73.2) > iniparse (0.4) > initial-setup (0.3.40) > IPy (0.81) > +ipykernel (4.6.1) > +ipython (6.2.0) > +ipython-genutils (0.2.0) > ipywidgets (7.0.0) > isc (1.0) > javapackages (4.6.0) > +jedi (0.11.0) > +Jinja2 (2.9.6) > +jsonschema (2.6.0) > jupyter (1.0.0) > +jupyter-client (5.1.0) > +jupyter-console (5.2.0) > +jupyter-core (4.3.0) > langtable (0.0.35) > lazy-object-proxy (1.2.1) > lxml (3.7.2) > +MarkupSafe (1.0) > +matplotlib (2.1.0) > +mistune (0.7.4) > +nbconvert (5.3.1) > +nbformat (4.4.0) > +notebook (5.1.0) > ntplib (0.3.3) > numpy (1.13.3) > ordered-set (2.0.0) > pandas (0.20.3) > +pandocfilters (1.4.2) > +parso (0.1.0) > +pexpect (4.2.1) > +pickleshare (0.7.4) > pid (2.0.1) > Pillow (3.2.0) > pip (9.0.1) > +prompt-toolkit (1.0.15) > +ptyprocess (0.5.2) > pwquality (1.3.0) > pycups (1.9.72) > pycurl (7.43.0) > pyenchant (1.6.8) > +Pygments (2.2.0) > pygobject (3.20.1) > pygpgme (0.3) > pyinotify (0.9.6) > @@ -42,6 +68,7 @@ > pylint (1.5.6) > pyparsing (2.2.0) > pyparted (3.10.7) > +PyQt5 (5.9) > PySocks (1.5.6) > python-augeas (0.5.0) > python-dateutil (2.6.1) > @@ -50,6 +77,9 @@ > pytz (2017.2) > pyudev (0.21.0) > pyxdg (0.25) > +pyzmq (16.0.2) > +qtconsole (4.3.1) > +Quamash (0.5.5) > requests (2.10.0) > requests-file (1.4) > requests-ftp (0.3.1) > @@ -60,11 +90,21 @@ > sepolicy (1.1) > setroubleshoot (1.1) > setuptools (20.1.1) > +simplegeneric (0.8.1) > +sip (4.19.3) > six (1.11.0) > slip (0.6.4) > slip.dbus (0.6.4) > sos (3.2) > SSSDConfig (1.15.3) > systemd-python (232) > +terminado (0.6) > +testpath (0.3.1) > +tornado (4.5.2) > +traitlets (4.3.2) > +tws-async (0.5.5) > urllib3 (1.15.1) > +wcwidth (0.1.7) > +webencodings (0.5.1) > +widgetsnbextension (3.0.3) > wrapt (1.10.10) > > > I just removed html5lib from system(root) , but tha made no difference to > the plotting.. > > > > > > On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: > >> hello, >> the issue i'm experiencing is local to my laptop ( the other machines i >> have run examples just fine). >> I described it here https://www.mail-archive.com/p >> ython-list at python.org/msg432343.html in details. >> i searched around, but none of the proposed workarounds helped. >> >> Is there a way to enable some-kind of debugging or verbose output to see >> what exactly is happening behind the scene? >> >> Thank you. >> AZ >> >> > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Mon Nov 6 16:17:50 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 6 Nov 2017 16:17:50 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: Just to make absolutely clear, you set the default backend in your matplotlibrc file to "agg" and it still hung on you? If that is the case, then the problem isn't tkinter. Some possibilities are 1) a massive font database that matplotlib is trying to build a cache for 2) import of matplotlib from somewhere else unexpected (which would explain pycharm's behavior), and that file/module is misbehaving. We have seen instances in the past where users would name their plotting porting of their code "matplotlib.py" or "pylab.py" or some such, and then start to wonder why their code doesn't work properly. Have you looked to see if there are other programs that are running during the import stage? One thing matplotlib does for the first import is to create a font cache, and it does this by using some fc-list program, iirc. This can take a long time on some machines that have adobe's font collection installed, for example, but that is usually a Windows thing.... Ben Root On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z wrote: > Tkinter was most likely installed as part of rpm install. > Backends - not really. I do know that with mpld3and agg the scripts hang. > Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) and > with pip3. > Today i tried on the office machine (fedora 25). Rpm brings only > matplot1.5. > > maybe 2 installed locally using pip3 messes with 1.5 leftover or libraries. > Not sure how to validate this idea though.. > Probably unrelated: > In pycharm pyplot is not been recognized as part of matplotlib when i > "import matplotlib.pyplot. yet the script doesnt crash on import > statement... > > > > > > On Nov 6, 2017 15:13, "Benjamin Root" wrote: > > How did you install Tkinter? Have you tested any other backends? Does this > happen for just the head-less "Agg" backend set as default? > > On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: > >> more relevant information: >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib >> >>> matplotlib.__file__ >> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >> >>> matplotlib.get_configdir() >> '/home/az/.config/matplotlib' >> >>> print(matplotlib.__version__) >> 2.1.0 >> >> now if i get the simplest plot : >> >> [az at hp src]$ more ./main1.py >> import matplotlib.pyplot as plt >> print("imported") >> plt.plot([1,2,4,1]) >> print("plot is done") >> plt.show() >> print("show is done") >> >> [az at hp src]$ python3.5 main1.py --verbose-debug >> $HOME=/home/az >> matplotlib data path /home/az/.local/lib/python3.5/ >> site-packages/matplotlib/mpl-data >> loaded rc file /home/az/.local/lib/python3.5/ >> site-packages/matplotlib/mpl-data/matplotlibrc >> matplotlib version 2.1.0 >> verbose.level debug >> interactive is False >> platform is linux >> loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', >> 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', >> 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', >> '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', >> 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', >> 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', >> 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', >> 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', >> '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', >> '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', >> 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', >> 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', >> 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' >> numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', >> 'encodings.cp437', 'numpy.polynomial.polynomial', >> 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', >> 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', >> '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', >> 'selectors', 'numpy.core', 'json.encoder', 'operator', >> 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', >> 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', >> 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', >> 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', >> 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', >> 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', >> 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', >> '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', >> 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', >> 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', >> 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', >> 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' >> numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', >> 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', >> 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', >> 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', >> 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', >> 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', >> 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', >> 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', >> 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', >> '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', >> 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', >> '_random', 'email.iterators', '_collections_abc', '__future__', 'email', >> 'numpy._distributor_init', 'unittest.loader', '_bootlocale', >> 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', >> 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', >> 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', >> 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', >> 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', >> 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', >> 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', >> 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', >> 'locale', 'email.errors', 'numpy.core.numerictypes', >> 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', >> 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', >> 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', >> 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', >> 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', >> 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', >> 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', >> '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', >> 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', >> 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', >> 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', >> 'unittest.result', 're', 'http.client', 'numpy.lib.info', >> 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', >> 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', >> 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', >> 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', >> 'builtins'] >> CACHEDIR=/home/az/.cache/matplotlib >> Using fontManager instance from /home/az/.cache/matplotlib/fontList.json >> backend TkAgg version 8.6 >> imported >> ^C >> Hangs at this point with CPU @ 100% >> >> grep -v '#' /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-d >> ata/matplotlibrc >> >> The only line is : >> backend : TkAgg >> >> >> [az at hp src]$ gcc --version >> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >> >> I installed using pip3 into --user directory. >> but i also remember that i used dnf to get tkInnter installed: >> rpm -qa | grep tkin >> python3-tkinter-3.5.3-6.fc24.x86_64 >> tkinter-2.7.13-2.fc24.x86_64 >> tix-1:8.4.3-17.fc24.x86_64 >> if i were to compare "pip3 list" between system (root) and the user (az): >> diff -u /tmp/root_pip /tmp/usr_pip >> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >> @@ -1,39 +1,65 @@ >> astroid (1.4.5) >> beautifulsoup4 (4.6.0) >> +bleach (2.1) >> blivet (1.20.3) >> chardet (2.2.1) >> coverage (4.4.1) >> cssselect (0.9.1) >> cupshelpers (1.0) >> +cx-Oracle (6.0.2) >> cycler (0.10.0) >> decorator (4.0.11) >> distro (1.0.2) >> dnf-langpacks (0.15.1) >> +entrypoints (0.2.3) >> fros (1.1) >> -html5lib (0.999) >> +html5lib (1.0b10) >> humanize (0.5.1) >> ib-insync (0.8.5) >> +ibapi (9.73.2) >> iniparse (0.4) >> initial-setup (0.3.40) >> IPy (0.81) >> +ipykernel (4.6.1) >> +ipython (6.2.0) >> +ipython-genutils (0.2.0) >> ipywidgets (7.0.0) >> isc (1.0) >> javapackages (4.6.0) >> +jedi (0.11.0) >> +Jinja2 (2.9.6) >> +jsonschema (2.6.0) >> jupyter (1.0.0) >> +jupyter-client (5.1.0) >> +jupyter-console (5.2.0) >> +jupyter-core (4.3.0) >> langtable (0.0.35) >> lazy-object-proxy (1.2.1) >> lxml (3.7.2) >> +MarkupSafe (1.0) >> +matplotlib (2.1.0) >> +mistune (0.7.4) >> +nbconvert (5.3.1) >> +nbformat (4.4.0) >> +notebook (5.1.0) >> ntplib (0.3.3) >> numpy (1.13.3) >> ordered-set (2.0.0) >> pandas (0.20.3) >> +pandocfilters (1.4.2) >> +parso (0.1.0) >> +pexpect (4.2.1) >> +pickleshare (0.7.4) >> pid (2.0.1) >> Pillow (3.2.0) >> pip (9.0.1) >> +prompt-toolkit (1.0.15) >> +ptyprocess (0.5.2) >> pwquality (1.3.0) >> pycups (1.9.72) >> pycurl (7.43.0) >> pyenchant (1.6.8) >> +Pygments (2.2.0) >> pygobject (3.20.1) >> pygpgme (0.3) >> pyinotify (0.9.6) >> @@ -42,6 +68,7 @@ >> pylint (1.5.6) >> pyparsing (2.2.0) >> pyparted (3.10.7) >> +PyQt5 (5.9) >> PySocks (1.5.6) >> python-augeas (0.5.0) >> python-dateutil (2.6.1) >> @@ -50,6 +77,9 @@ >> pytz (2017.2) >> pyudev (0.21.0) >> pyxdg (0.25) >> +pyzmq (16.0.2) >> +qtconsole (4.3.1) >> +Quamash (0.5.5) >> requests (2.10.0) >> requests-file (1.4) >> requests-ftp (0.3.1) >> @@ -60,11 +90,21 @@ >> sepolicy (1.1) >> setroubleshoot (1.1) >> setuptools (20.1.1) >> +simplegeneric (0.8.1) >> +sip (4.19.3) >> six (1.11.0) >> slip (0.6.4) >> slip.dbus (0.6.4) >> sos (3.2) >> SSSDConfig (1.15.3) >> systemd-python (232) >> +terminado (0.6) >> +testpath (0.3.1) >> +tornado (4.5.2) >> +traitlets (4.3.2) >> +tws-async (0.5.5) >> urllib3 (1.15.1) >> +wcwidth (0.1.7) >> +webencodings (0.5.1) >> +widgetsnbextension (3.0.3) >> wrapt (1.10.10) >> >> >> I just removed html5lib from system(root) , but tha made no difference to >> the plotting.. >> >> >> >> >> >> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: >> >>> hello, >>> the issue i'm experiencing is local to my laptop ( the other machines i >>> have run examples just fine). >>> I described it here https://www.mail-archive.com/p >>> ython-list at python.org/msg432343.html in details. >>> i searched around, but none of the proposed workarounds helped. >>> >>> Is there a way to enable some-kind of debugging or verbose output to >>> see what exactly is happening behind the scene? >>> >>> Thank you. >>> AZ >>> >>> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Mon Nov 6 16:48:44 2017 From: formisc at gmail.com (Andrew Z) Date: Mon, 6 Nov 2017 16:48:44 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: >backend in your matplotlibrc file to "agg" and it still hung on you? Yes. I can confirm that >Some possibilities are >...."matplotlib.py" or "pylab.py" or some such, and then start to wonder why their code doesn't work properly. I used pycharms "scratch files" and typed directly in the interpreter- always same result. I saw this naming issue whileresearching my problem. My file is plot.py and works perfectly fine on any other machine but this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also consistent across machines (minus username) >Have you looked to see if there are other programs that are running during the import stage? Im not sure what do you mean? I have a xwindow terminal , nothing but Firefox is up.(well a tons of regular background processes). On Nov 6, 2017 16:18, "Benjamin Root" wrote: > Just to make absolutely clear, you set the default backend in your > matplotlibrc file to "agg" and it still hung on you? If that is the case, > then the problem isn't tkinter. > > Some possibilities are > > 1) a massive font database that matplotlib is trying to build a cache for > 2) import of matplotlib from somewhere else unexpected (which would > explain pycharm's behavior), and that file/module is misbehaving. We have > seen instances in the past where users would name their plotting porting of > their code "matplotlib.py" or "pylab.py" or some such, and then start to > wonder why their code doesn't work properly. > > Have you looked to see if there are other programs that are running during > the import stage? One thing matplotlib does for the first import is to > create a font cache, and it does this by using some fc-list program, iirc. > This can take a long time on some machines that have adobe's font > collection installed, for example, but that is usually a Windows thing.... > > Ben Root > > > On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z wrote: > >> Tkinter was most likely installed as part of rpm install. >> Backends - not really. I do know that with mpld3and agg the scripts hang. >> Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) and >> with pip3. >> Today i tried on the office machine (fedora 25). Rpm brings only >> matplot1.5. >> >> maybe 2 installed locally using pip3 messes with 1.5 leftover or >> libraries. >> Not sure how to validate this idea though.. >> Probably unrelated: >> In pycharm pyplot is not been recognized as part of matplotlib when i >> "import matplotlib.pyplot. yet the script doesnt crash on import >> statement... >> >> >> >> >> >> On Nov 6, 2017 15:13, "Benjamin Root" wrote: >> >> How did you install Tkinter? Have you tested any other backends? Does >> this happen for just the head-less "Agg" backend set as default? >> >> On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: >> >>> more relevant information: >>> [az at hp src]$ python3.5 >>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> import matplotlib >>> >>> matplotlib.__file__ >>> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >>> >>> matplotlib.get_configdir() >>> '/home/az/.config/matplotlib' >>> >>> print(matplotlib.__version__) >>> 2.1.0 >>> >>> now if i get the simplest plot : >>> >>> [az at hp src]$ more ./main1.py >>> import matplotlib.pyplot as plt >>> print("imported") >>> plt.plot([1,2,4,1]) >>> print("plot is done") >>> plt.show() >>> print("show is done") >>> >>> [az at hp src]$ python3.5 main1.py --verbose-debug >>> $HOME=/home/az >>> matplotlib data path /home/az/.local/lib/python3.5/ >>> site-packages/matplotlib/mpl-data >>> loaded rc file /home/az/.local/lib/python3.5/ >>> site-packages/matplotlib/mpl-data/matplotlibrc >>> matplotlib version 2.1.0 >>> verbose.level debug >>> interactive is False >>> platform is linux >>> loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', >>> 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', >>> 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', >>> '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', >>> 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', >>> 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', >>> 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', >>> 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', >>> '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', >>> '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', >>> 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', >>> 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', >>> 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' >>> numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', >>> 'encodings.cp437', 'numpy.polynomial.polynomial', >>> 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', >>> 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', >>> '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', >>> 'selectors', 'numpy.core', 'json.encoder', 'operator', >>> 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', >>> 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', >>> 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', >>> 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', >>> 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', >>> 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', >>> 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', >>> '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', >>> 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', >>> 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', >>> 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', >>> 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' >>> numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', >>> 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', >>> 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', >>> 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', >>> 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', >>> 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', >>> 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', >>> 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', >>> 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', >>> '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', >>> 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', >>> '_random', 'email.iterators', '_collections_abc', '__future__', 'email', >>> 'numpy._distributor_init', 'unittest.loader', '_bootlocale', >>> 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', >>> 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', >>> 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', >>> 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', >>> 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', >>> 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', >>> 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', >>> 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', >>> 'locale', 'email.errors', 'numpy.core.numerictypes', >>> 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', >>> 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', >>> 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', >>> 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', >>> 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', >>> 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', >>> 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', >>> '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', >>> 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', >>> 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', >>> 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', >>> 'unittest.result', 're', 'http.client', 'numpy.lib.info', >>> 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', >>> 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', >>> 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', >>> 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', >>> 'builtins'] >>> CACHEDIR=/home/az/.cache/matplotlib >>> Using fontManager instance from /home/az/.cache/matplotlib/fontList.json >>> backend TkAgg version 8.6 >>> imported >>> ^C >>> Hangs at this point with CPU @ 100% >>> >>> grep -v '#' /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-d >>> ata/matplotlibrc >>> >>> The only line is : >>> backend : TkAgg >>> >>> >>> [az at hp src]$ gcc --version >>> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >>> >>> I installed using pip3 into --user directory. >>> but i also remember that i used dnf to get tkInnter installed: >>> rpm -qa | grep tkin >>> python3-tkinter-3.5.3-6.fc24.x86_64 >>> tkinter-2.7.13-2.fc24.x86_64 >>> tix-1:8.4.3-17.fc24.x86_64 >>> if i were to compare "pip3 list" between system (root) and the user (az): >>> diff -u /tmp/root_pip /tmp/usr_pip >>> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >>> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >>> @@ -1,39 +1,65 @@ >>> astroid (1.4.5) >>> beautifulsoup4 (4.6.0) >>> +bleach (2.1) >>> blivet (1.20.3) >>> chardet (2.2.1) >>> coverage (4.4.1) >>> cssselect (0.9.1) >>> cupshelpers (1.0) >>> +cx-Oracle (6.0.2) >>> cycler (0.10.0) >>> decorator (4.0.11) >>> distro (1.0.2) >>> dnf-langpacks (0.15.1) >>> +entrypoints (0.2.3) >>> fros (1.1) >>> -html5lib (0.999) >>> +html5lib (1.0b10) >>> humanize (0.5.1) >>> ib-insync (0.8.5) >>> +ibapi (9.73.2) >>> iniparse (0.4) >>> initial-setup (0.3.40) >>> IPy (0.81) >>> +ipykernel (4.6.1) >>> +ipython (6.2.0) >>> +ipython-genutils (0.2.0) >>> ipywidgets (7.0.0) >>> isc (1.0) >>> javapackages (4.6.0) >>> +jedi (0.11.0) >>> +Jinja2 (2.9.6) >>> +jsonschema (2.6.0) >>> jupyter (1.0.0) >>> +jupyter-client (5.1.0) >>> +jupyter-console (5.2.0) >>> +jupyter-core (4.3.0) >>> langtable (0.0.35) >>> lazy-object-proxy (1.2.1) >>> lxml (3.7.2) >>> +MarkupSafe (1.0) >>> +matplotlib (2.1.0) >>> +mistune (0.7.4) >>> +nbconvert (5.3.1) >>> +nbformat (4.4.0) >>> +notebook (5.1.0) >>> ntplib (0.3.3) >>> numpy (1.13.3) >>> ordered-set (2.0.0) >>> pandas (0.20.3) >>> +pandocfilters (1.4.2) >>> +parso (0.1.0) >>> +pexpect (4.2.1) >>> +pickleshare (0.7.4) >>> pid (2.0.1) >>> Pillow (3.2.0) >>> pip (9.0.1) >>> +prompt-toolkit (1.0.15) >>> +ptyprocess (0.5.2) >>> pwquality (1.3.0) >>> pycups (1.9.72) >>> pycurl (7.43.0) >>> pyenchant (1.6.8) >>> +Pygments (2.2.0) >>> pygobject (3.20.1) >>> pygpgme (0.3) >>> pyinotify (0.9.6) >>> @@ -42,6 +68,7 @@ >>> pylint (1.5.6) >>> pyparsing (2.2.0) >>> pyparted (3.10.7) >>> +PyQt5 (5.9) >>> PySocks (1.5.6) >>> python-augeas (0.5.0) >>> python-dateutil (2.6.1) >>> @@ -50,6 +77,9 @@ >>> pytz (2017.2) >>> pyudev (0.21.0) >>> pyxdg (0.25) >>> +pyzmq (16.0.2) >>> +qtconsole (4.3.1) >>> +Quamash (0.5.5) >>> requests (2.10.0) >>> requests-file (1.4) >>> requests-ftp (0.3.1) >>> @@ -60,11 +90,21 @@ >>> sepolicy (1.1) >>> setroubleshoot (1.1) >>> setuptools (20.1.1) >>> +simplegeneric (0.8.1) >>> +sip (4.19.3) >>> six (1.11.0) >>> slip (0.6.4) >>> slip.dbus (0.6.4) >>> sos (3.2) >>> SSSDConfig (1.15.3) >>> systemd-python (232) >>> +terminado (0.6) >>> +testpath (0.3.1) >>> +tornado (4.5.2) >>> +traitlets (4.3.2) >>> +tws-async (0.5.5) >>> urllib3 (1.15.1) >>> +wcwidth (0.1.7) >>> +webencodings (0.5.1) >>> +widgetsnbextension (3.0.3) >>> wrapt (1.10.10) >>> >>> >>> I just removed html5lib from system(root) , but tha made no difference >>> to the plotting.. >>> >>> >>> >>> >>> >>> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: >>> >>>> hello, >>>> the issue i'm experiencing is local to my laptop ( the other machines >>>> i have run examples just fine). >>>> I described it here https://www.mail-archive.com/p >>>> ython-list at python.org/msg432343.html in details. >>>> i searched around, but none of the proposed workarounds helped. >>>> >>>> Is there a way to enable some-kind of debugging or verbose output to >>>> see what exactly is happening behind the scene? >>>> >>>> Thank you. >>>> AZ >>>> >>>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Mon Nov 6 18:33:40 2017 From: formisc at gmail.com (Andrew Z) Date: Mon, 6 Nov 2017 18:33:40 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: this is what i have installed: [az at hp src]$ rpm -qa | grep tkint python3-tkinter-3.5.3-6.fc24.x86_64 tkinter-2.7.13-2.fc24.x86_64 [az at hp src]$ [az at hp src]$ pip3 list | grep tk DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. rpm -qa | grep matplot python-matplotlib-data-fonts-1.5.2-0.1.rc2.fc24.noarch python3-matplotlib-1.5.2-0.1.rc2.fc24.x86_64 python3-matplotlib-tk-1.5.2-0.1.rc2.fc24.x86_64 python-matplotlib-data-1.5.2-0.1.rc2.fc24.noarch basically i removed the pip3 installed matplot and felt back to rpm provided in hope to have that config working. Copy/paste from https://matplotlib.org/gallery/pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py [az at hp src]$ which python3.5 /usr/bin/python3.5 [az at hp src]$ file /usr/bin/python3.5 /usr/bin/python3.5: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cc90b759ab34ba1043b3a96779f17eba4c0baf7a, stripped [az at hp src]$ [az at hp src]$ python3.5 Python 3.5.3 (default, May 11 2017, 09:10:41) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt >>> plt.plot([1,2,3,4]) Terminated [az at hp src]$ [az at hp src]$ [az at hp src]$ python3.5 Python 3.5.3 (default, May 11 2017, 09:10:41) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt >>> import matplotlib >>> matplotlib.get_backend() 'TkAgg' >>> exit Use exit() or Ctrl-D (i.e. EOF) to exit removing TKagg from config: [az at hp src]$ find / -name matplotlibrc* 2>>/dev/null /etc/matplotlibrc [az at hp src]$ grep -v ^# /etc/matplotlibrc backend : TkAgg changing to Agg and running the same code: [az at hp src]$ python3.5 Python 3.5.3 (default, May 11 2017, 09:10:41) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.get_backend() 'agg' >>> import matplotlib.pyplot as plt >>> plt.ylabel('some numbers') ^C^Z [1]+ Stopped python3.5 [az at hp src]$ python3.5 Python 3.5.3 (default, May 11 2017, 09:10:41) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt >>> plt.plot([1,2,3,4]) I'll stop making any changes to the env now, since i don't want to bring any confusion into the matter. thank you for helping out! On Mon, Nov 6, 2017 at 4:48 PM, Andrew Z wrote: > > >backend in your matplotlibrc file to "agg" and it still hung on you? > > Yes. I can confirm that > > >Some possibilities are > >...."matplotlib.py" or "pylab.py" or some such, and then start to wonder > why their code doesn't work properly. > > I used pycharms "scratch files" and typed directly in the interpreter- > always same result. I saw this naming issue whileresearching my problem. My > file is plot.py and works perfectly fine on any other machine but > this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also > consistent across machines (minus username) > > >Have you looked to see if there are other programs that are running > during the import stage? > > Im not sure what do you mean? > I have a xwindow terminal , nothing but Firefox is up.(well a tons of > regular background processes). > > > > > On Nov 6, 2017 16:18, "Benjamin Root" wrote: > >> Just to make absolutely clear, you set the default backend in your >> matplotlibrc file to "agg" and it still hung on you? If that is the case, >> then the problem isn't tkinter. >> >> Some possibilities are >> >> 1) a massive font database that matplotlib is trying to build a cache for >> 2) import of matplotlib from somewhere else unexpected (which would >> explain pycharm's behavior), and that file/module is misbehaving. We have >> seen instances in the past where users would name their plotting porting of >> their code "matplotlib.py" or "pylab.py" or some such, and then start to >> wonder why their code doesn't work properly. >> >> Have you looked to see if there are other programs that are running >> during the import stage? One thing matplotlib does for the first import is >> to create a font cache, and it does this by using some fc-list program, >> iirc. This can take a long time on some machines that have adobe's font >> collection installed, for example, but that is usually a Windows thing.... >> >> Ben Root >> >> >> On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z wrote: >> >>> Tkinter was most likely installed as part of rpm install. >>> Backends - not really. I do know that with mpld3and agg the scripts >>> hang. >>> Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) and >>> with pip3. >>> Today i tried on the office machine (fedora 25). Rpm brings only >>> matplot1.5. >>> >>> maybe 2 installed locally using pip3 messes with 1.5 leftover or >>> libraries. >>> Not sure how to validate this idea though.. >>> Probably unrelated: >>> In pycharm pyplot is not been recognized as part of matplotlib when i >>> "import matplotlib.pyplot. yet the script doesnt crash on import >>> statement... >>> >>> >>> >>> >>> >>> On Nov 6, 2017 15:13, "Benjamin Root" wrote: >>> >>> How did you install Tkinter? Have you tested any other backends? Does >>> this happen for just the head-less "Agg" backend set as default? >>> >>> On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: >>> >>>> more relevant information: >>>> [az at hp src]$ python3.5 >>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>> Type "help", "copyright", "credits" or "license" for more information. >>>> >>> import matplotlib >>>> >>> matplotlib.__file__ >>>> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >>>> >>> matplotlib.get_configdir() >>>> '/home/az/.config/matplotlib' >>>> >>> print(matplotlib.__version__) >>>> 2.1.0 >>>> >>>> now if i get the simplest plot : >>>> >>>> [az at hp src]$ more ./main1.py >>>> import matplotlib.pyplot as plt >>>> print("imported") >>>> plt.plot([1,2,4,1]) >>>> print("plot is done") >>>> plt.show() >>>> print("show is done") >>>> >>>> [az at hp src]$ python3.5 main1.py --verbose-debug >>>> $HOME=/home/az >>>> matplotlib data path /home/az/.local/lib/python3.5/ >>>> site-packages/matplotlib/mpl-data >>>> loaded rc file /home/az/.local/lib/python3.5/ >>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>> matplotlib version 2.1.0 >>>> verbose.level debug >>>> interactive is False >>>> platform is linux >>>> loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', >>>> 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', >>>> 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', >>>> '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', >>>> 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', >>>> 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', >>>> 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', >>>> 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', >>>> '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', >>>> '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', >>>> 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', >>>> 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', >>>> 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' >>>> numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', >>>> 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', >>>> 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', >>>> 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', >>>> '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', >>>> 'selectors', 'numpy.core', 'json.encoder', 'operator', >>>> 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', >>>> 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', >>>> 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', >>>> 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', >>>> 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', >>>> 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', >>>> 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', >>>> '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', >>>> 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', >>>> 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', >>>> 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', >>>> 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' >>>> numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', >>>> 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', >>>> 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', >>>> 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', >>>> 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', >>>> 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', >>>> 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', >>>> 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', >>>> 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', >>>> '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', >>>> 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', >>>> '_random', 'email.iterators', '_collections_abc', '__future__', 'email', >>>> 'numpy._distributor_init', 'unittest.loader', '_bootlocale', >>>> 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', >>>> 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', >>>> 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', >>>> 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', >>>> 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', >>>> 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', >>>> 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', >>>> 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', >>>> 'locale', 'email.errors', 'numpy.core.numerictypes', >>>> 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', >>>> 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', >>>> 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', >>>> 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', >>>> 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', >>>> 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', >>>> 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', >>>> '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', >>>> 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', >>>> 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', >>>> 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', >>>> 'unittest.result', 're', 'http.client', 'numpy.lib.info', >>>> 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', >>>> 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', >>>> 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', >>>> 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', >>>> 'builtins'] >>>> CACHEDIR=/home/az/.cache/matplotlib >>>> Using fontManager instance from /home/az/.cache/matplotlib/fon >>>> tList.json >>>> backend TkAgg version 8.6 >>>> imported >>>> ^C >>>> Hangs at this point with CPU @ 100% >>>> >>>> grep -v '#' /home/az/.local/lib/python3.5/ >>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>> >>>> The only line is : >>>> backend : TkAgg >>>> >>>> >>>> [az at hp src]$ gcc --version >>>> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >>>> >>>> I installed using pip3 into --user directory. >>>> but i also remember that i used dnf to get tkInnter installed: >>>> rpm -qa | grep tkin >>>> python3-tkinter-3.5.3-6.fc24.x86_64 >>>> tkinter-2.7.13-2.fc24.x86_64 >>>> tix-1:8.4.3-17.fc24.x86_64 >>>> if i were to compare "pip3 list" between system (root) and the user >>>> (az): >>>> diff -u /tmp/root_pip /tmp/usr_pip >>>> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >>>> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >>>> @@ -1,39 +1,65 @@ >>>> astroid (1.4.5) >>>> beautifulsoup4 (4.6.0) >>>> +bleach (2.1) >>>> blivet (1.20.3) >>>> chardet (2.2.1) >>>> coverage (4.4.1) >>>> cssselect (0.9.1) >>>> cupshelpers (1.0) >>>> +cx-Oracle (6.0.2) >>>> cycler (0.10.0) >>>> decorator (4.0.11) >>>> distro (1.0.2) >>>> dnf-langpacks (0.15.1) >>>> +entrypoints (0.2.3) >>>> fros (1.1) >>>> -html5lib (0.999) >>>> +html5lib (1.0b10) >>>> humanize (0.5.1) >>>> ib-insync (0.8.5) >>>> +ibapi (9.73.2) >>>> iniparse (0.4) >>>> initial-setup (0.3.40) >>>> IPy (0.81) >>>> +ipykernel (4.6.1) >>>> +ipython (6.2.0) >>>> +ipython-genutils (0.2.0) >>>> ipywidgets (7.0.0) >>>> isc (1.0) >>>> javapackages (4.6.0) >>>> +jedi (0.11.0) >>>> +Jinja2 (2.9.6) >>>> +jsonschema (2.6.0) >>>> jupyter (1.0.0) >>>> +jupyter-client (5.1.0) >>>> +jupyter-console (5.2.0) >>>> +jupyter-core (4.3.0) >>>> langtable (0.0.35) >>>> lazy-object-proxy (1.2.1) >>>> lxml (3.7.2) >>>> +MarkupSafe (1.0) >>>> +matplotlib (2.1.0) >>>> +mistune (0.7.4) >>>> +nbconvert (5.3.1) >>>> +nbformat (4.4.0) >>>> +notebook (5.1.0) >>>> ntplib (0.3.3) >>>> numpy (1.13.3) >>>> ordered-set (2.0.0) >>>> pandas (0.20.3) >>>> +pandocfilters (1.4.2) >>>> +parso (0.1.0) >>>> +pexpect (4.2.1) >>>> +pickleshare (0.7.4) >>>> pid (2.0.1) >>>> Pillow (3.2.0) >>>> pip (9.0.1) >>>> +prompt-toolkit (1.0.15) >>>> +ptyprocess (0.5.2) >>>> pwquality (1.3.0) >>>> pycups (1.9.72) >>>> pycurl (7.43.0) >>>> pyenchant (1.6.8) >>>> +Pygments (2.2.0) >>>> pygobject (3.20.1) >>>> pygpgme (0.3) >>>> pyinotify (0.9.6) >>>> @@ -42,6 +68,7 @@ >>>> pylint (1.5.6) >>>> pyparsing (2.2.0) >>>> pyparted (3.10.7) >>>> +PyQt5 (5.9) >>>> PySocks (1.5.6) >>>> python-augeas (0.5.0) >>>> python-dateutil (2.6.1) >>>> @@ -50,6 +77,9 @@ >>>> pytz (2017.2) >>>> pyudev (0.21.0) >>>> pyxdg (0.25) >>>> +pyzmq (16.0.2) >>>> +qtconsole (4.3.1) >>>> +Quamash (0.5.5) >>>> requests (2.10.0) >>>> requests-file (1.4) >>>> requests-ftp (0.3.1) >>>> @@ -60,11 +90,21 @@ >>>> sepolicy (1.1) >>>> setroubleshoot (1.1) >>>> setuptools (20.1.1) >>>> +simplegeneric (0.8.1) >>>> +sip (4.19.3) >>>> six (1.11.0) >>>> slip (0.6.4) >>>> slip.dbus (0.6.4) >>>> sos (3.2) >>>> SSSDConfig (1.15.3) >>>> systemd-python (232) >>>> +terminado (0.6) >>>> +testpath (0.3.1) >>>> +tornado (4.5.2) >>>> +traitlets (4.3.2) >>>> +tws-async (0.5.5) >>>> urllib3 (1.15.1) >>>> +wcwidth (0.1.7) >>>> +webencodings (0.5.1) >>>> +widgetsnbextension (3.0.3) >>>> wrapt (1.10.10) >>>> >>>> >>>> I just removed html5lib from system(root) , but tha made no difference >>>> to the plotting.. >>>> >>>> >>>> >>>> >>>> >>>> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: >>>> >>>>> hello, >>>>> the issue i'm experiencing is local to my laptop ( the other machines >>>>> i have run examples just fine). >>>>> I described it here https://www.mail-archive.com/p >>>>> ython-list at python.org/msg432343.html in details. >>>>> i searched around, but none of the proposed workarounds helped. >>>>> >>>>> Is there a way to enable some-kind of debugging or verbose output to >>>>> see what exactly is happening behind the scene? >>>>> >>>>> Thank you. >>>>> AZ >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From borreguero at gmail.com Tue Nov 7 17:19:02 2017 From: borreguero at gmail.com (Jose Borreguero) Date: Tue, 7 Nov 2017 17:19:02 -0500 Subject: [Matplotlib-users] confused with name of certain events Message-ID: Dear Matplotlib gurus, The following example prints the event.name for two events: ? 'figure_enter_event' and 'axes_enter_event': from __future__ import print_function import matplotlib.pyplot as plt fig, ax = plt.subplots() fig.canvas.mpl_connect('figure_enter_event', lambda event: print(f'enter figure: {event.name}')) fig.canvas.mpl_connect('axes_enter_event', lambda event: print(f'enter axes: {event.name}')) plt.show() This is what I get ?when ? hovering the mouse ? over the canvas:? enter figure: figure_enter_event enter axes: motion_notify_event enter figure: figure_enter_event enter axes: motion_notify_event What is the reason for 'motion_notify_event' being the assigned name to axes_enter_event but not figure_enter_event ? ? Best, .Jose? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Tue Nov 7 17:33:46 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Tue, 7 Nov 2017 17:33:46 -0500 Subject: [Matplotlib-users] confused with name of certain events In-Reply-To: References: Message-ID: Jose, First, bonus points for your excellent use of f-strings! You are right. It is an odd inconsistency that I sort of noticed when I wrote my book. The 'figure_enter_event' is of type "Event", so its name falls back to the default of itself. Meanwhile, all of the other enter/leave events are of type LocationEvent, which have different default names. Not sure if this is something that warrants fixing or not. We don't have really good documentation for the event system anyway, but this has been this way for a very long time. What do you think? How is it impacting your use-case? Cheers! Ben Root On Tue, Nov 7, 2017 at 5:19 PM, Jose Borreguero wrote: > Dear Matplotlib gurus, > > The following example prints the event.name > for two events: ? > 'figure_enter_event' and 'axes_enter_event': > > from __future__ import print_function > import matplotlib.pyplot as plt > fig, ax = plt.subplots() > fig.canvas.mpl_connect('figure_enter_event', > lambda event: print(f'enter figure: {event.name}')) > fig.canvas.mpl_connect('axes_enter_event', > lambda event: print(f'enter axes: {event.name}')) > plt.show() > > This is what I get > ?when ? > hovering the mouse > ? over the canvas:? > > enter figure: figure_enter_event > enter axes: motion_notify_event > enter figure: figure_enter_event > enter axes: motion_notify_event > > What is the reason for 'motion_notify_event' being the assigned name to > axes_enter_event but not figure_enter_event > ? ? > > Best, > .Jose? > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Wed Nov 8 10:10:15 2017 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Wed, 8 Nov 2017 10:10:15 -0500 Subject: [Matplotlib-users] changing labeling of axes Message-ID: Hi, I'm wondering if anyone knows of a good way to relabel axes for a particular case I'm dealing with. I'm making a 2D histogram, using hist2d of course. The thing is that for my case, where I'm plotting the density vs. pressure for results from a hydro run, it makes more sense to use the log of the quantities as the inputs for hist2d. So then I need to give the log of the density and pressure to hist2d. This works fine for making the histogram, but then the axes are labelled with log10(n), log10(P). I'd prefer to have the axes labelled as for a logarithmic plot, so instead of say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can just specify by hand the ticks and tick labels, though that's kind of a pain. Any help would be appreciated. Regards, Jon -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA jslavin at cfa.harvard.edu 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 cell: (781) 363-0035 USA ________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Wed Nov 8 10:25:08 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Wed, 8 Nov 2017 10:25:08 -0500 Subject: [Matplotlib-users] changing labeling of axes In-Reply-To: References: Message-ID: You can do `ax.set_xscale('log')` to set the x-axis to log scale and similarly for the y-axis. It'll automatically make the tick labels make sense. Also, you won't need to pass in the log10 of n or P, matplotlib will handle all of that for you. Cheers! Ben Root On Wed, Nov 8, 2017 at 10:10 AM, Slavin, Jonathan wrote: > Hi, > > I'm wondering if anyone knows of a good way to relabel axes for a > particular case I'm dealing with. I'm making a 2D histogram, using hist2d > of course. The thing is that for my case, where I'm plotting the density > vs. pressure for results from a hydro run, it makes more sense to use the > log of the quantities as the inputs for hist2d. So then I need to give the > log of the density and pressure to hist2d. This works fine for making the > histogram, but then the axes are labelled with log10(n), log10(P). I'd > prefer to have the axes labelled as for a logarithmic plot, so instead of > say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can > just specify by hand the ticks and tick labels, though that's kind of a > pain. Any help would be appreciated. > > Regards, > Jon > > -- > ________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > jslavin at cfa.harvard.edu 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > cell: (781) 363-0035 USA > ________________________________________________________ > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Wed Nov 8 11:09:39 2017 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Wed, 8 Nov 2017 11:09:39 -0500 Subject: [Matplotlib-users] changing labeling of axes Message-ID: Hi Ben, The issue with that is that I want to retain the logarithmic binning. If I change the xscale/yscale to log with the binning as set up now, then it will try to scale the log values logarithmically. So I still want the axes to be scaled in the same way, I just want the labeling of the axes to be different. Is that clear? Jon On Wed, Nov 8, 2017 at 10:25 AM, Benjamin Root wrote: > You can do `ax.set_xscale('log')` to set the x-axis to log scale and > similarly for the y-axis. It'll automatically make the tick labels make > sense. Also, you won't need to pass in the log10 of n or P, matplotlib will > handle all of that for you. > > Cheers! > Ben Root > > > On Wed, Nov 8, 2017 at 10:10 AM, Slavin, Jonathan > wrote: > >> Hi, >> >> I'm wondering if anyone knows of a good way to relabel axes for a >> particular case I'm dealing with. I'm making a 2D histogram, using hist2d >> of course. The thing is that for my case, where I'm plotting the density >> vs. pressure for results from a hydro run, it makes more sense to use the >> log of the quantities as the inputs for hist2d. So then I need to give the >> log of the density and pressure to hist2d. This works fine for making the >> histogram, but then the axes are labelled with log10(n), log10(P). I'd >> prefer to have the axes labelled as for a logarithmic plot, so instead of >> say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can >> just specify by hand the ticks and tick labels, though that's kind of a >> pain. Any help would be appreciated. >> >> Regards, >> Jon >> >> -- >> ________________________________________________________ >> Jonathan D. Slavin Harvard-Smithsonian CfA >> jslavin at cfa.harvard.edu 60 Garden Street, MS 83 >> phone: (617) 496-7981 Cambridge, MA 02138-1516 >> cell: (781) 363-0035 USA >> ________________________________________________________ >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA jslavin at cfa.harvard.edu 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 cell: (781) 363-0035 USA ________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Wed Nov 8 11:21:34 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Wed, 8 Nov 2017 11:21:34 -0500 Subject: [Matplotlib-users] changing labeling of axes In-Reply-To: References: Message-ID: Ah, then you need to simply change the tick formatter. Here are some examples: https://matplotlib.org/devdocs/gallery/ticks_and_spines/tick-formatters.html Cheers! Ben Root On Wed, Nov 8, 2017 at 11:09 AM, Slavin, Jonathan wrote: > Hi Ben, > > The issue with that is that I want to retain the logarithmic binning. If I > change the xscale/yscale to log with the binning as set up now, then it > will try to scale the log values logarithmically. So I still want the axes > to be scaled in the same way, I just want the labeling of the axes to be > different. Is that clear? > > Jon > > On Wed, Nov 8, 2017 at 10:25 AM, Benjamin Root > wrote: > >> You can do `ax.set_xscale('log')` to set the x-axis to log scale and >> similarly for the y-axis. It'll automatically make the tick labels make >> sense. Also, you won't need to pass in the log10 of n or P, matplotlib will >> handle all of that for you. >> >> Cheers! >> Ben Root >> >> >> On Wed, Nov 8, 2017 at 10:10 AM, Slavin, Jonathan < >> jslavin at cfa.harvard.edu> wrote: >> >>> Hi, >>> >>> I'm wondering if anyone knows of a good way to relabel axes for a >>> particular case I'm dealing with. I'm making a 2D histogram, using hist2d >>> of course. The thing is that for my case, where I'm plotting the density >>> vs. pressure for results from a hydro run, it makes more sense to use the >>> log of the quantities as the inputs for hist2d. So then I need to give the >>> log of the density and pressure to hist2d. This works fine for making the >>> histogram, but then the axes are labelled with log10(n), log10(P). I'd >>> prefer to have the axes labelled as for a logarithmic plot, so instead of >>> say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can >>> just specify by hand the ticks and tick labels, though that's kind of a >>> pain. Any help would be appreciated. >>> >>> Regards, >>> Jon >>> >>> -- >>> ________________________________________________________ >>> Jonathan D. Slavin Harvard-Smithsonian CfA >>> jslavin at cfa.harvard.edu 60 Garden Street, MS 83 >>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>> cell: (781) 363-0035 USA >>> ________________________________________________________ >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> > > > -- > ________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > jslavin at cfa.harvard.edu 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > cell: (781) 363-0035 USA > ________________________________________________________ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Wed Nov 8 12:01:06 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 08 Nov 2017 17:01:06 +0000 Subject: [Matplotlib-users] changing labeling of axes In-Reply-To: References: Message-ID: You can do this with the formatter on the axis, see https://matplotlib.org/gallery/ticks_and_spines/tick-formatters.html#sphx-glr-gallery-ticks-and-spines-tick-formatters-py and https://matplotlib.org/api/ticker_api.html You can also pass log-spaced bins to `hist2D` and then set the axis scales to log (but trying to construct an example did not got as I expected...) Tom On Wed, Nov 8, 2017 at 10:10 AM Slavin, Jonathan wrote: > Hi, > > I'm wondering if anyone knows of a good way to relabel axes for a > particular case I'm dealing with. I'm making a 2D histogram, using hist2d > of course. The thing is that for my case, where I'm plotting the density > vs. pressure for results from a hydro run, it makes more sense to use the > log of the quantities as the inputs for hist2d. So then I need to give the > log of the density and pressure to hist2d. This works fine for making the > histogram, but then the axes are labelled with log10(n), log10(P). I'd > prefer to have the axes labelled as for a logarithmic plot, so instead of > say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can > just specify by hand the ticks and tick labels, though that's kind of a > pain. Any help would be appreciated. > > Regards, > Jon > > -- > ________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > jslavin at cfa.harvard.edu 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > cell: (781) 363-0035 USA > ________________________________________________________ > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Wed Nov 8 13:50:13 2017 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Wed, 8 Nov 2017 13:50:13 -0500 Subject: [Matplotlib-users] changing labeling of axes In-Reply-To: References: Message-ID: I was able to get the major ticks labeled in the way I want by doing: ax.xaxis.set_major_formatter(ticker.FuncFormatter(lambda x,pos: r'$10^{%i}$'% x)) I don't get any minor ticks that way. I could live with that, though I'd prefer to get logarithmically spaced minor ticks. I tried ax.xaxis.set_minor_locator(ticker.LogLocator()) but that seemed to have no effect. The idea of providing logarithmically bin edges seems like a good one, but as Tom says does not do what is expected. I tried using numpy's histogram2d providing logarithmically spaced bins and it worked as expected (though for some reason the array returned was transposed), so I think this is a bug in hist2d. Jon On Wed, Nov 8, 2017 at 12:01 PM, Thomas Caswell wrote: > You can do this with the formatter on the axis, see > https://matplotlib.org/gallery/ticks_and_spines/tick- > formatters.html#sphx-glr-gallery-ticks-and-spines-tick-formatters-py and > https://matplotlib.org/api/ticker_api.html > > You can also pass log-spaced bins to `hist2D` and then set the axis scales > to log (but trying to construct an example did not got as I expected...) > > Tom > > On Wed, Nov 8, 2017 at 10:10 AM Slavin, Jonathan > wrote: > >> Hi, >> >> I'm wondering if anyone knows of a good way to relabel axes for a >> particular case I'm dealing with. I'm making a 2D histogram, using hist2d >> of course. The thing is that for my case, where I'm plotting the density >> vs. pressure for results from a hydro run, it makes more sense to use the >> log of the quantities as the inputs for hist2d. So then I need to give the >> log of the density and pressure to hist2d. This works fine for making the >> histogram, but then the axes are labelled with log10(n), log10(P). I'd >> prefer to have the axes labelled as for a logarithmic plot, so instead of >> say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can >> just specify by hand the ticks and tick labels, though that's kind of a >> pain. Any help would be appreciated. >> >> Regards, >> Jon >> >> -- >> ________________________________________________________ >> Jonathan D. Slavin Harvard-Smithsonian CfA >> jslavin at cfa.harvard.edu 60 Garden Street, MS 83 >> phone: (617) 496-7981 Cambridge, MA 02138-1516 >> cell: (781) 363-0035 USA >> ________________________________________________________ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA jslavin at cfa.harvard.edu 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 cell: (781) 363-0035 USA ________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Wed Nov 8 14:01:51 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Wed, 8 Nov 2017 14:01:51 -0500 Subject: [Matplotlib-users] changing labeling of axes In-Reply-To: References: Message-ID: By default, the minor ticks are turned off. You have to turn it on yourself. This is one of the things that set_xscale('log') does for you automatically. On Wed, Nov 8, 2017 at 1:50 PM, Slavin, Jonathan wrote: > I was able to get the major ticks labeled in the way I want by doing: > ax.xaxis.set_major_formatter(ticker.FuncFormatter(lambda x,pos: > r'$10^{%i}$'% x)) > I don't get any minor ticks that way. I could live with that, though I'd > prefer to get logarithmically spaced minor ticks. I tried > ax.xaxis.set_minor_locator(ticker.LogLocator()) > but that seemed to have no effect. > > The idea of providing logarithmically bin edges seems like a good one, > but as Tom says does not do what is expected. I tried using numpy's > histogram2d providing logarithmically spaced bins and it worked as expected > (though for some reason the array returned was transposed), so I think this > is a bug in hist2d. > > Jon > > On Wed, Nov 8, 2017 at 12:01 PM, Thomas Caswell > wrote: > >> You can do this with the formatter on the axis, see >> https://matplotlib.org/gallery/ticks_and_spines/tick-for >> matters.html#sphx-glr-gallery-ticks-and-spines-tick-formatters-py and >> https://matplotlib.org/api/ticker_api.html >> >> You can also pass log-spaced bins to `hist2D` and then set the axis >> scales to log (but trying to construct an example did not got as I >> expected...) >> >> Tom >> >> On Wed, Nov 8, 2017 at 10:10 AM Slavin, Jonathan >> wrote: >> >>> Hi, >>> >>> I'm wondering if anyone knows of a good way to relabel axes for a >>> particular case I'm dealing with. I'm making a 2D histogram, using hist2d >>> of course. The thing is that for my case, where I'm plotting the density >>> vs. pressure for results from a hydro run, it makes more sense to use the >>> log of the quantities as the inputs for hist2d. So then I need to give the >>> log of the density and pressure to hist2d. This works fine for making the >>> histogram, but then the axes are labelled with log10(n), log10(P). I'd >>> prefer to have the axes labelled as for a logarithmic plot, so instead of >>> say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can >>> just specify by hand the ticks and tick labels, though that's kind of a >>> pain. Any help would be appreciated. >>> >>> Regards, >>> Jon >>> >>> -- >>> ________________________________________________________ >>> Jonathan D. Slavin Harvard-Smithsonian CfA >>> jslavin at cfa.harvard.edu 60 Garden Street, MS 83 >>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>> cell: (781) 363-0035 USA >>> ________________________________________________________ >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >> > > > -- > ________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > jslavin at cfa.harvard.edu 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > cell: (781) 363-0035 USA > ________________________________________________________ > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Wed Nov 8 15:05:59 2017 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Wed, 8 Nov 2017 15:05:59 -0500 Subject: [Matplotlib-users] changing labeling of axes In-Reply-To: References: Message-ID: Actually I have now found a better approach. What I do is create the histogram using numpy.histogram2d with logarithmic bins as input. Then I use pcolormesh to create the plot. I'm basically following the lead shown on the numpy.histogram2d page. Jon On Wed, Nov 8, 2017 at 2:01 PM, Benjamin Root wrote: > By default, the minor ticks are turned off. You have to turn it on > yourself. This is one of the things that set_xscale('log') does for you > automatically. > > On Wed, Nov 8, 2017 at 1:50 PM, Slavin, Jonathan > wrote: > >> I was able to get the major ticks labeled in the way I want by doing: >> ax.xaxis.set_major_formatter(ticker.FuncFormatter(lambda x,pos: >> r'$10^{%i}$'% x)) >> I don't get any minor ticks that way. I could live with that, though I'd >> prefer to get logarithmically spaced minor ticks. I tried >> ax.xaxis.set_minor_locator(ticker.LogLocator()) >> but that seemed to have no effect. >> >> The idea of providing logarithmically bin edges seems like a good one, >> but as Tom says does not do what is expected. I tried using numpy's >> histogram2d providing logarithmically spaced bins and it worked as expected >> (though for some reason the array returned was transposed), so I think this >> is a bug in hist2d. >> >> Jon >> >> On Wed, Nov 8, 2017 at 12:01 PM, Thomas Caswell >> wrote: >> >>> You can do this with the formatter on the axis, see >>> https://matplotlib.org/gallery/ticks_and_spines/tick-for >>> matters.html#sphx-glr-gallery-ticks-and-spines-tick-formatters-py and >>> https://matplotlib.org/api/ticker_api.html >>> >>> You can also pass log-spaced bins to `hist2D` and then set the axis >>> scales to log (but trying to construct an example did not got as I >>> expected...) >>> >>> Tom >>> >>> On Wed, Nov 8, 2017 at 10:10 AM Slavin, Jonathan < >>> jslavin at cfa.harvard.edu> wrote: >>> >>>> Hi, >>>> >>>> I'm wondering if anyone knows of a good way to relabel axes for a >>>> particular case I'm dealing with. I'm making a 2D histogram, using hist2d >>>> of course. The thing is that for my case, where I'm plotting the density >>>> vs. pressure for results from a hydro run, it makes more sense to use the >>>> log of the quantities as the inputs for hist2d. So then I need to give the >>>> log of the density and pressure to hist2d. This works fine for making the >>>> histogram, but then the axes are labelled with log10(n), log10(P). I'd >>>> prefer to have the axes labelled as for a logarithmic plot, so instead of >>>> say 4.0, 10^4. Is there a simple way of doing that. I'm pretty sure I can >>>> just specify by hand the ticks and tick labels, though that's kind of a >>>> pain. Any help would be appreciated. >>>> >>>> Regards, >>>> Jon >>>> >>>> -- >>>> ________________________________________________________ >>>> Jonathan D. Slavin Harvard-Smithsonian CfA >>>> jslavin at cfa.harvard.edu 60 Garden Street, MS 83 >>>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>>> cell: (781) 363-0035 USA >>>> ________________________________________________________ >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>> >> >> >> -- >> ________________________________________________________ >> Jonathan D. Slavin Harvard-Smithsonian CfA >> jslavin at cfa.harvard.edu 60 Garden Street, MS 83 >> phone: (617) 496-7981 Cambridge, MA 02138-1516 >> cell: (781) 363-0035 USA >> ________________________________________________________ >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA jslavin at cfa.harvard.edu 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 cell: (781) 363-0035 USA ________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Wed Nov 8 16:41:07 2017 From: formisc at gmail.com (Andrew Z) Date: Wed, 8 Nov 2017 16:41:07 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: I tried PyQT5 with the same unhappy results: First, i verified that pyqt5 works - PyQt5 (5.9.1) - Python bindings for the Qt cross platform UI and application toolkit INSTALLED: 5.9 LATEST: 5.9.1 ran http://www.thehackeruniversity.com/2014/01/23/pyqt5-beginner-tutorial/ - exampled worked with no issues. Everything got resolved in pycharm. next installed the matplot backend: python3-matplotlib-qt5.x86_64 ran examples from here https://pythonspot.com/en/pyqt5-matplotlib/ - and it hanged. pycharm is complaining about : from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure import matplotlib.pyplot as plt "can not find reference 'backends' in __init__.py' ' unresolved reference backend_qt5agg' 'cant reference 'figure' ' 'no module named pyplot' On Mon, Nov 6, 2017 at 6:33 PM, Andrew Z wrote: > this is what i have installed: > [az at hp src]$ rpm -qa | grep tkint > python3-tkinter-3.5.3-6.fc24.x86_64 > tkinter-2.7.13-2.fc24.x86_64 > [az at hp src]$ > > > [az at hp src]$ pip3 list | grep tk > DEPRECATION: The default format will switch to columns in the future. You > can use --format=(legacy|columns) (or define a format=(legacy|columns) in > your pip.conf under the [list] section) to disable this warning. > > > rpm -qa | grep matplot > python-matplotlib-data-fonts-1.5.2-0.1.rc2.fc24.noarch > python3-matplotlib-1.5.2-0.1.rc2.fc24.x86_64 > python3-matplotlib-tk-1.5.2-0.1.rc2.fc24.x86_64 > python-matplotlib-data-1.5.2-0.1.rc2.fc24.noarch > > basically i removed the pip3 installed matplot and felt back to rpm > provided in hope to have that config working. > > Copy/paste from https://matplotlib.org/gallery/pyplots/pyplot_simple. > html#sphx-glr-gallery-pyplots-pyplot-simple-py > [az at hp src]$ which python3.5 > /usr/bin/python3.5 > [az at hp src]$ file /usr/bin/python3.5 > /usr/bin/python3.5: ELF 64-bit LSB shared object, x86-64, version 1 > (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for > GNU/Linux 2.6.32, BuildID[sha1]=cc90b759ab34ba1043b3a96779f17eba4c0baf7a, > stripped > [az at hp src]$ > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib.pyplot as plt > >>> plt.plot([1,2,3,4]) > > Terminated > [az at hp src]$ > [az at hp src]$ > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib.pyplot as plt > >>> import matplotlib > >>> matplotlib.get_backend() > 'TkAgg' > >>> exit > Use exit() or Ctrl-D (i.e. EOF) to exit > > removing TKagg from config: > [az at hp src]$ find / -name matplotlibrc* 2>>/dev/null > /etc/matplotlibrc > [az at hp src]$ grep -v ^# /etc/matplotlibrc > backend : TkAgg > > changing to Agg and running the same code: > > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib > >>> matplotlib.get_backend() > 'agg' > >>> import matplotlib.pyplot as plt > >>> plt.ylabel('some numbers') > ^C^Z > [1]+ Stopped python3.5 > > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib.pyplot as plt > >>> plt.plot([1,2,3,4]) > > > I'll stop making any changes to the env now, since i don't want to bring > any confusion into the matter. > thank you for helping out! > > > > > > > > > On Mon, Nov 6, 2017 at 4:48 PM, Andrew Z wrote: > >> >> >backend in your matplotlibrc file to "agg" and it still hung on you? >> >> Yes. I can confirm that >> >> >Some possibilities are >> >...."matplotlib.py" or "pylab.py" or some such, and then start to wonder >> why their code doesn't work properly. >> >> I used pycharms "scratch files" and typed directly in the interpreter- >> always same result. I saw this naming issue whileresearching my problem. My >> file is plot.py and works perfectly fine on any other machine but >> this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also >> consistent across machines (minus username) >> >> >Have you looked to see if there are other programs that are running >> during the import stage? >> >> Im not sure what do you mean? >> I have a xwindow terminal , nothing but Firefox is up.(well a tons of >> regular background processes). >> >> >> >> >> On Nov 6, 2017 16:18, "Benjamin Root" wrote: >> >>> Just to make absolutely clear, you set the default backend in your >>> matplotlibrc file to "agg" and it still hung on you? If that is the case, >>> then the problem isn't tkinter. >>> >>> Some possibilities are >>> >>> 1) a massive font database that matplotlib is trying to build a cache for >>> 2) import of matplotlib from somewhere else unexpected (which would >>> explain pycharm's behavior), and that file/module is misbehaving. We have >>> seen instances in the past where users would name their plotting porting of >>> their code "matplotlib.py" or "pylab.py" or some such, and then start to >>> wonder why their code doesn't work properly. >>> >>> Have you looked to see if there are other programs that are running >>> during the import stage? One thing matplotlib does for the first import is >>> to create a font cache, and it does this by using some fc-list program, >>> iirc. This can take a long time on some machines that have adobe's font >>> collection installed, for example, but that is usually a Windows thing.... >>> >>> Ben Root >>> >>> >>> On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z wrote: >>> >>>> Tkinter was most likely installed as part of rpm install. >>>> Backends - not really. I do know that with mpld3and agg the scripts >>>> hang. >>>> Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) >>>> and with pip3. >>>> Today i tried on the office machine (fedora 25). Rpm brings only >>>> matplot1.5. >>>> >>>> maybe 2 installed locally using pip3 messes with 1.5 leftover or >>>> libraries. >>>> Not sure how to validate this idea though.. >>>> Probably unrelated: >>>> In pycharm pyplot is not been recognized as part of matplotlib when i >>>> "import matplotlib.pyplot. yet the script doesnt crash on import >>>> statement... >>>> >>>> >>>> >>>> >>>> >>>> On Nov 6, 2017 15:13, "Benjamin Root" wrote: >>>> >>>> How did you install Tkinter? Have you tested any other backends? Does >>>> this happen for just the head-less "Agg" backend set as default? >>>> >>>> On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: >>>> >>>>> more relevant information: >>>>> [az at hp src]$ python3.5 >>>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>>> Type "help", "copyright", "credits" or "license" for more information. >>>>> >>> import matplotlib >>>>> >>> matplotlib.__file__ >>>>> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >>>>> >>> matplotlib.get_configdir() >>>>> '/home/az/.config/matplotlib' >>>>> >>> print(matplotlib.__version__) >>>>> 2.1.0 >>>>> >>>>> now if i get the simplest plot : >>>>> >>>>> [az at hp src]$ more ./main1.py >>>>> import matplotlib.pyplot as plt >>>>> print("imported") >>>>> plt.plot([1,2,4,1]) >>>>> print("plot is done") >>>>> plt.show() >>>>> print("show is done") >>>>> >>>>> [az at hp src]$ python3.5 main1.py --verbose-debug >>>>> $HOME=/home/az >>>>> matplotlib data path /home/az/.local/lib/python3.5/ >>>>> site-packages/matplotlib/mpl-data >>>>> loaded rc file /home/az/.local/lib/python3.5/ >>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>> matplotlib version 2.1.0 >>>>> verbose.level debug >>>>> interactive is False >>>>> platform is linux >>>>> loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', >>>>> 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', >>>>> 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', >>>>> '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', >>>>> 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', >>>>> 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', >>>>> 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', >>>>> 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', >>>>> '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', >>>>> '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', >>>>> 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', >>>>> 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', >>>>> 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' >>>>> numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', >>>>> 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', >>>>> 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', >>>>> 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', >>>>> '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', >>>>> 'selectors', 'numpy.core', 'json.encoder', 'operator', >>>>> 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', >>>>> 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', >>>>> 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', >>>>> 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', >>>>> 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', >>>>> 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', >>>>> 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', >>>>> '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', >>>>> 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', >>>>> 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', >>>>> 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', >>>>> 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' >>>>> numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', >>>>> 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', >>>>> 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', >>>>> 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', >>>>> 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', >>>>> 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', >>>>> 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', >>>>> 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', >>>>> 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', >>>>> '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', >>>>> 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', >>>>> '_random', 'email.iterators', '_collections_abc', '__future__', 'email', >>>>> 'numpy._distributor_init', 'unittest.loader', '_bootlocale', >>>>> 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', >>>>> 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', >>>>> 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', >>>>> 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', >>>>> 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', >>>>> 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', >>>>> 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', >>>>> 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', >>>>> 'locale', 'email.errors', 'numpy.core.numerictypes', >>>>> 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', >>>>> 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', >>>>> 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', >>>>> 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', >>>>> 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', >>>>> 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', >>>>> 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', >>>>> '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', >>>>> 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', >>>>> 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', >>>>> 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', >>>>> 'unittest.result', 're', 'http.client', 'numpy.lib.info', >>>>> 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', >>>>> 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', >>>>> 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', >>>>> 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', >>>>> 'builtins'] >>>>> CACHEDIR=/home/az/.cache/matplotlib >>>>> Using fontManager instance from /home/az/.cache/matplotlib/fon >>>>> tList.json >>>>> backend TkAgg version 8.6 >>>>> imported >>>>> ^C >>>>> Hangs at this point with CPU @ 100% >>>>> >>>>> grep -v '#' /home/az/.local/lib/python3.5/ >>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>> >>>>> The only line is : >>>>> backend : TkAgg >>>>> >>>>> >>>>> [az at hp src]$ gcc --version >>>>> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >>>>> >>>>> I installed using pip3 into --user directory. >>>>> but i also remember that i used dnf to get tkInnter installed: >>>>> rpm -qa | grep tkin >>>>> python3-tkinter-3.5.3-6.fc24.x86_64 >>>>> tkinter-2.7.13-2.fc24.x86_64 >>>>> tix-1:8.4.3-17.fc24.x86_64 >>>>> if i were to compare "pip3 list" between system (root) and the user >>>>> (az): >>>>> diff -u /tmp/root_pip /tmp/usr_pip >>>>> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >>>>> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >>>>> @@ -1,39 +1,65 @@ >>>>> astroid (1.4.5) >>>>> beautifulsoup4 (4.6.0) >>>>> +bleach (2.1) >>>>> blivet (1.20.3) >>>>> chardet (2.2.1) >>>>> coverage (4.4.1) >>>>> cssselect (0.9.1) >>>>> cupshelpers (1.0) >>>>> +cx-Oracle (6.0.2) >>>>> cycler (0.10.0) >>>>> decorator (4.0.11) >>>>> distro (1.0.2) >>>>> dnf-langpacks (0.15.1) >>>>> +entrypoints (0.2.3) >>>>> fros (1.1) >>>>> -html5lib (0.999) >>>>> +html5lib (1.0b10) >>>>> humanize (0.5.1) >>>>> ib-insync (0.8.5) >>>>> +ibapi (9.73.2) >>>>> iniparse (0.4) >>>>> initial-setup (0.3.40) >>>>> IPy (0.81) >>>>> +ipykernel (4.6.1) >>>>> +ipython (6.2.0) >>>>> +ipython-genutils (0.2.0) >>>>> ipywidgets (7.0.0) >>>>> isc (1.0) >>>>> javapackages (4.6.0) >>>>> +jedi (0.11.0) >>>>> +Jinja2 (2.9.6) >>>>> +jsonschema (2.6.0) >>>>> jupyter (1.0.0) >>>>> +jupyter-client (5.1.0) >>>>> +jupyter-console (5.2.0) >>>>> +jupyter-core (4.3.0) >>>>> langtable (0.0.35) >>>>> lazy-object-proxy (1.2.1) >>>>> lxml (3.7.2) >>>>> +MarkupSafe (1.0) >>>>> +matplotlib (2.1.0) >>>>> +mistune (0.7.4) >>>>> +nbconvert (5.3.1) >>>>> +nbformat (4.4.0) >>>>> +notebook (5.1.0) >>>>> ntplib (0.3.3) >>>>> numpy (1.13.3) >>>>> ordered-set (2.0.0) >>>>> pandas (0.20.3) >>>>> +pandocfilters (1.4.2) >>>>> +parso (0.1.0) >>>>> +pexpect (4.2.1) >>>>> +pickleshare (0.7.4) >>>>> pid (2.0.1) >>>>> Pillow (3.2.0) >>>>> pip (9.0.1) >>>>> +prompt-toolkit (1.0.15) >>>>> +ptyprocess (0.5.2) >>>>> pwquality (1.3.0) >>>>> pycups (1.9.72) >>>>> pycurl (7.43.0) >>>>> pyenchant (1.6.8) >>>>> +Pygments (2.2.0) >>>>> pygobject (3.20.1) >>>>> pygpgme (0.3) >>>>> pyinotify (0.9.6) >>>>> @@ -42,6 +68,7 @@ >>>>> pylint (1.5.6) >>>>> pyparsing (2.2.0) >>>>> pyparted (3.10.7) >>>>> +PyQt5 (5.9) >>>>> PySocks (1.5.6) >>>>> python-augeas (0.5.0) >>>>> python-dateutil (2.6.1) >>>>> @@ -50,6 +77,9 @@ >>>>> pytz (2017.2) >>>>> pyudev (0.21.0) >>>>> pyxdg (0.25) >>>>> +pyzmq (16.0.2) >>>>> +qtconsole (4.3.1) >>>>> +Quamash (0.5.5) >>>>> requests (2.10.0) >>>>> requests-file (1.4) >>>>> requests-ftp (0.3.1) >>>>> @@ -60,11 +90,21 @@ >>>>> sepolicy (1.1) >>>>> setroubleshoot (1.1) >>>>> setuptools (20.1.1) >>>>> +simplegeneric (0.8.1) >>>>> +sip (4.19.3) >>>>> six (1.11.0) >>>>> slip (0.6.4) >>>>> slip.dbus (0.6.4) >>>>> sos (3.2) >>>>> SSSDConfig (1.15.3) >>>>> systemd-python (232) >>>>> +terminado (0.6) >>>>> +testpath (0.3.1) >>>>> +tornado (4.5.2) >>>>> +traitlets (4.3.2) >>>>> +tws-async (0.5.5) >>>>> urllib3 (1.15.1) >>>>> +wcwidth (0.1.7) >>>>> +webencodings (0.5.1) >>>>> +widgetsnbextension (3.0.3) >>>>> wrapt (1.10.10) >>>>> >>>>> >>>>> I just removed html5lib from system(root) , but tha made no difference >>>>> to the plotting.. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: >>>>> >>>>>> hello, >>>>>> the issue i'm experiencing is local to my laptop ( the other >>>>>> machines i have run examples just fine). >>>>>> I described it here https://www.mail-archive.com/p >>>>>> ython-list at python.org/msg432343.html in details. >>>>>> i searched around, but none of the proposed workarounds helped. >>>>>> >>>>>> Is there a way to enable some-kind of debugging or verbose output to >>>>>> see what exactly is happening behind the scene? >>>>>> >>>>>> Thank you. >>>>>> AZ >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Matplotlib-users at python.org >>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>> >>>>> >>>> >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Wed Nov 8 16:53:16 2017 From: formisc at gmail.com (Andrew Z) Date: Wed, 8 Nov 2017 16:53:16 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: Jody, what do i need to use ? i've been using either dnf or pip3 depending on the situation ( if i want to install in to user's env - > pip3 ir system wide - dnf ). On Wed, Nov 8, 2017 at 4:50 PM, Jody Klymak wrote: > Andrew, > > Can I *strongly* suggest you just use anaconda, unless you have some > compelling reason not to? > > It takes care of most of these packaging headaches. I guess I?m ignorant > about pycharm, but I?m pretty sure people use it w/ pycharm. > > Cheers, Jody > > > On 8 Nov 2017, at 13:41 PM, Andrew Z wrote: > > I tried PyQT5 with the same unhappy results: > > First, i verified that pyqt5 works - > > PyQt5 (5.9.1) - Python bindings for the Qt cross > platform UI and application toolkit > INSTALLED: 5.9 > LATEST: 5.9.1 > > ran http://www.thehackeruniversity.com/2014/01/23/pyqt5-beginner-tutorial/ > - exampled worked with no issues. Everything got resolved in pycharm. > > next installed the matplot backend: > python3-matplotlib-qt5.x86_64 > > ran examples from here https://pythonspot.com/en/pyqt5-matplotlib/ - and > it hanged. > pycharm is complaining about : > > from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas > from matplotlib.figure import Figure > import matplotlib.pyplot as plt > > "can not find reference 'backends' in __init__.py' > ' unresolved reference backend_qt5agg' > 'cant reference 'figure' ' > 'no module named pyplot' > > > > > > On Mon, Nov 6, 2017 at 6:33 PM, Andrew Z wrote: > >> this is what i have installed: >> [az at hp src]$ rpm -qa | grep tkint >> python3-tkinter-3.5.3-6.fc24.x86_64 >> tkinter-2.7.13-2.fc24.x86_64 >> [az at hp src]$ >> >> >> [az at hp src]$ pip3 list | grep tk >> DEPRECATION: The default format will switch to columns in the future. You >> can use --format=(legacy|columns) (or define a format=(legacy|columns) in >> your pip.conf under the [list] section) to disable this warning. >> >> >> rpm -qa | grep matplot >> python-matplotlib-data-fonts-1.5.2-0.1.rc2.fc24.noarch >> python3-matplotlib-1.5.2-0.1.rc2.fc24.x86_64 >> python3-matplotlib-tk-1.5.2-0.1.rc2.fc24.x86_64 >> python-matplotlib-data-1.5.2-0.1.rc2.fc24.noarch >> >> basically i removed the pip3 installed matplot and felt back to rpm >> provided in hope to have that config working. >> >> Copy/paste from https://matplotlib.org/gallery >> /pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py >> [az at hp src]$ which python3.5 >> /usr/bin/python3.5 >> [az at hp src]$ file /usr/bin/python3.5 >> /usr/bin/python3.5: ELF 64-bit LSB shared object, x86-64, version 1 >> (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for >> GNU/Linux 2.6.32, BuildID[sha1]=cc90b759ab34ba1043b3a96779f17eba4c0baf7a, >> stripped >> [az at hp src]$ >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib.pyplot as plt >> >>> plt.plot([1,2,3,4]) >> >> Terminated >> [az at hp src]$ >> [az at hp src]$ >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib.pyplot as plt >> >>> import matplotlib >> >>> matplotlib.get_backend() >> 'TkAgg' >> >>> exit >> Use exit() or Ctrl-D (i.e. EOF) to exit >> >> removing TKagg from config: >> [az at hp src]$ find / -name matplotlibrc* 2>>/dev/null >> /etc/matplotlibrc >> [az at hp src]$ grep -v ^# /etc/matplotlibrc >> backend : TkAgg >> >> changing to Agg and running the same code: >> >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib >> >>> matplotlib.get_backend() >> 'agg' >> >>> import matplotlib.pyplot as plt >> >>> plt.ylabel('some numbers') >> ^C^Z >> [1]+ Stopped python3.5 >> >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib.pyplot as plt >> >>> plt.plot([1,2,3,4]) >> >> >> I'll stop making any changes to the env now, since i don't want to bring >> any confusion into the matter. >> thank you for helping out! >> >> >> >> >> >> >> >> >> On Mon, Nov 6, 2017 at 4:48 PM, Andrew Z wrote: >> >>> >>> >backend in your matplotlibrc file to "agg" and it still hung on you? >>> >>> Yes. I can confirm that >>> >>> >Some possibilities are >>> >...."matplotlib.py" or "pylab.py" or some such, and then start to >>> wonder why their code doesn't work properly. >>> >>> I used pycharms "scratch files" and typed directly in the interpreter- >>> always same result. I saw this naming issue whileresearching my problem. My >>> file is plot.py and works perfectly fine on any other machine but >>> this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also >>> consistent across machines (minus username) >>> >>> >Have you looked to see if there are other programs that are running >>> during the import stage? >>> >>> Im not sure what do you mean? >>> I have a xwindow terminal , nothing but Firefox is up.(well a tons of >>> regular background processes). >>> >>> >>> >>> >>> On Nov 6, 2017 16:18, "Benjamin Root" wrote: >>> >>>> Just to make absolutely clear, you set the default backend in your >>>> matplotlibrc file to "agg" and it still hung on you? If that is the case, >>>> then the problem isn't tkinter. >>>> >>>> Some possibilities are >>>> >>>> 1) a massive font database that matplotlib is trying to build a cache >>>> for >>>> 2) import of matplotlib from somewhere else unexpected (which would >>>> explain pycharm's behavior), and that file/module is misbehaving. We have >>>> seen instances in the past where users would name their plotting porting of >>>> their code "matplotlib.py" or "pylab.py" or some such, and then start to >>>> wonder why their code doesn't work properly. >>>> >>>> Have you looked to see if there are other programs that are running >>>> during the import stage? One thing matplotlib does for the first import is >>>> to create a font cache, and it does this by using some fc-list program, >>>> iirc. This can take a long time on some machines that have adobe's font >>>> collection installed, for example, but that is usually a Windows thing.... >>>> >>>> Ben Root >>>> >>>> >>>> On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z wrote: >>>> >>>>> Tkinter was most likely installed as part of rpm install. >>>>> Backends - not really. I do know that with mpld3and agg the scripts >>>>> hang. >>>>> Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) >>>>> and with pip3. >>>>> Today i tried on the office machine (fedora 25). Rpm brings only >>>>> matplot1.5. >>>>> >>>>> maybe 2 installed locally using pip3 messes with 1.5 leftover or >>>>> libraries. >>>>> Not sure how to validate this idea though.. >>>>> Probably unrelated: >>>>> In pycharm pyplot is not been recognized as part of matplotlib when i >>>>> "import matplotlib.pyplot. yet the script doesnt crash on import >>>>> statement... >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Nov 6, 2017 15:13, "Benjamin Root" wrote: >>>>> >>>>> How did you install Tkinter? Have you tested any other backends? Does >>>>> this happen for just the head-less "Agg" backend set as default? >>>>> >>>>> On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: >>>>> >>>>>> more relevant information: >>>>>> [az at hp src]$ python3.5 >>>>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>>>> Type "help", "copyright", "credits" or "license" for more information. >>>>>> >>> import matplotlib >>>>>> >>> matplotlib.__file__ >>>>>> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >>>>>> >>> matplotlib.get_configdir() >>>>>> '/home/az/.config/matplotlib' >>>>>> >>> print(matplotlib.__version__) >>>>>> 2.1.0 >>>>>> >>>>>> now if i get the simplest plot : >>>>>> >>>>>> [az at hp src]$ more ./main1.py >>>>>> import matplotlib.pyplot as plt >>>>>> print("imported") >>>>>> plt.plot([1,2,4,1]) >>>>>> print("plot is done") >>>>>> plt.show() >>>>>> print("show is done") >>>>>> >>>>>> [az at hp src]$ python3.5 main1.py --verbose-debug >>>>>> $HOME=/home/az >>>>>> matplotlib data path /home/az/.local/lib/python3.5/ >>>>>> site-packages/matplotlib/mpl-data >>>>>> loaded rc file /home/az/.local/lib/python3.5/ >>>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>>> matplotlib version 2.1.0 >>>>>> verbose.level debug >>>>>> interactive is False >>>>>> platform is linux >>>>>> loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', >>>>>> 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', >>>>>> 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', >>>>>> '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', >>>>>> 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', >>>>>> 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', >>>>>> 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', >>>>>> 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', >>>>>> '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', >>>>>> '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', >>>>>> 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', >>>>>> 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', >>>>>> 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' >>>>>> numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', >>>>>> 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', >>>>>> 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', >>>>>> 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', >>>>>> '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', >>>>>> 'selectors', 'numpy.core', 'json.encoder', 'operator', >>>>>> 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', >>>>>> 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', >>>>>> 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', >>>>>> 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', >>>>>> 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', >>>>>> 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', >>>>>> 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', >>>>>> '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', >>>>>> 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info', >>>>>> 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', >>>>>> 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', >>>>>> 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', ' >>>>>> numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', 'grp', >>>>>> 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', >>>>>> 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', >>>>>> 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', >>>>>> 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', >>>>>> 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', >>>>>> 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', >>>>>> 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', >>>>>> 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', >>>>>> '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', >>>>>> 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', >>>>>> '_random', 'email.iterators', '_collections_abc', '__future__', 'email', >>>>>> 'numpy._distributor_init', 'unittest.loader', '_bootlocale', >>>>>> 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', >>>>>> 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', >>>>>> 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', >>>>>> 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', >>>>>> 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', >>>>>> 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', >>>>>> 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', >>>>>> 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', >>>>>> 'locale', 'email.errors', 'numpy.core.numerictypes', >>>>>> 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', >>>>>> 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', >>>>>> 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', >>>>>> 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', >>>>>> 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', >>>>>> 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', >>>>>> 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', >>>>>> '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', >>>>>> 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', >>>>>> 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', >>>>>> 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', >>>>>> 'unittest.result', 're', 'http.client', 'numpy.lib.info', >>>>>> 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', >>>>>> 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', >>>>>> 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', >>>>>> 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', >>>>>> 'builtins'] >>>>>> CACHEDIR=/home/az/.cache/matplotlib >>>>>> Using fontManager instance from /home/az/.cache/matplotlib/fon >>>>>> tList.json >>>>>> backend TkAgg version 8.6 >>>>>> imported >>>>>> ^C >>>>>> Hangs at this point with CPU @ 100% >>>>>> >>>>>> grep -v '#' /home/az/.local/lib/python3.5/ >>>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>>> >>>>>> The only line is : >>>>>> backend : TkAgg >>>>>> >>>>>> >>>>>> [az at hp src]$ gcc --version >>>>>> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >>>>>> >>>>>> I installed using pip3 into --user directory. >>>>>> but i also remember that i used dnf to get tkInnter installed: >>>>>> rpm -qa | grep tkin >>>>>> python3-tkinter-3.5.3-6.fc24.x86_64 >>>>>> tkinter-2.7.13-2.fc24.x86_64 >>>>>> tix-1:8.4.3-17.fc24.x86_64 >>>>>> if i were to compare "pip3 list" between system (root) and the user >>>>>> (az): >>>>>> diff -u /tmp/root_pip /tmp/usr_pip >>>>>> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >>>>>> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >>>>>> @@ -1,39 +1,65 @@ >>>>>> astroid (1.4.5) >>>>>> beautifulsoup4 (4.6.0) >>>>>> +bleach (2.1) >>>>>> blivet (1.20.3) >>>>>> chardet (2.2.1) >>>>>> coverage (4.4.1) >>>>>> cssselect (0.9.1) >>>>>> cupshelpers (1.0) >>>>>> +cx-Oracle (6.0.2) >>>>>> cycler (0.10.0) >>>>>> decorator (4.0.11) >>>>>> distro (1.0.2) >>>>>> dnf-langpacks (0.15.1) >>>>>> +entrypoints (0.2.3) >>>>>> fros (1.1) >>>>>> -html5lib (0.999) >>>>>> +html5lib (1.0b10) >>>>>> humanize (0.5.1) >>>>>> ib-insync (0.8.5) >>>>>> +ibapi (9.73.2) >>>>>> iniparse (0.4) >>>>>> initial-setup (0.3.40) >>>>>> IPy (0.81) >>>>>> +ipykernel (4.6.1) >>>>>> +ipython (6.2.0) >>>>>> +ipython-genutils (0.2.0) >>>>>> ipywidgets (7.0.0) >>>>>> isc (1.0) >>>>>> javapackages (4.6.0) >>>>>> +jedi (0.11.0) >>>>>> +Jinja2 (2.9.6) >>>>>> +jsonschema (2.6.0) >>>>>> jupyter (1.0.0) >>>>>> +jupyter-client (5.1.0) >>>>>> +jupyter-console (5.2.0) >>>>>> +jupyter-core (4.3.0) >>>>>> langtable (0.0.35) >>>>>> lazy-object-proxy (1.2.1) >>>>>> lxml (3.7.2) >>>>>> +MarkupSafe (1.0) >>>>>> +matplotlib (2.1.0) >>>>>> +mistune (0.7.4) >>>>>> +nbconvert (5.3.1) >>>>>> +nbformat (4.4.0) >>>>>> +notebook (5.1.0) >>>>>> ntplib (0.3.3) >>>>>> numpy (1.13.3) >>>>>> ordered-set (2.0.0) >>>>>> pandas (0.20.3) >>>>>> +pandocfilters (1.4.2) >>>>>> +parso (0.1.0) >>>>>> +pexpect (4.2.1) >>>>>> +pickleshare (0.7.4) >>>>>> pid (2.0.1) >>>>>> Pillow (3.2.0) >>>>>> pip (9.0.1) >>>>>> +prompt-toolkit (1.0.15) >>>>>> +ptyprocess (0.5.2) >>>>>> pwquality (1.3.0) >>>>>> pycups (1.9.72) >>>>>> pycurl (7.43.0) >>>>>> pyenchant (1.6.8) >>>>>> +Pygments (2.2.0) >>>>>> pygobject (3.20.1) >>>>>> pygpgme (0.3) >>>>>> pyinotify (0.9.6) >>>>>> @@ -42,6 +68,7 @@ >>>>>> pylint (1.5.6) >>>>>> pyparsing (2.2.0) >>>>>> pyparted (3.10.7) >>>>>> +PyQt5 (5.9) >>>>>> PySocks (1.5.6) >>>>>> python-augeas (0.5.0) >>>>>> python-dateutil (2.6.1) >>>>>> @@ -50,6 +77,9 @@ >>>>>> pytz (2017.2) >>>>>> pyudev (0.21.0) >>>>>> pyxdg (0.25) >>>>>> +pyzmq (16.0.2) >>>>>> +qtconsole (4.3.1) >>>>>> +Quamash (0.5.5) >>>>>> requests (2.10.0) >>>>>> requests-file (1.4) >>>>>> requests-ftp (0.3.1) >>>>>> @@ -60,11 +90,21 @@ >>>>>> sepolicy (1.1) >>>>>> setroubleshoot (1.1) >>>>>> setuptools (20.1.1) >>>>>> +simplegeneric (0.8.1) >>>>>> +sip (4.19.3) >>>>>> six (1.11.0) >>>>>> slip (0.6.4) >>>>>> slip.dbus (0.6.4) >>>>>> sos (3.2) >>>>>> SSSDConfig (1.15.3) >>>>>> systemd-python (232) >>>>>> +terminado (0.6) >>>>>> +testpath (0.3.1) >>>>>> +tornado (4.5.2) >>>>>> +traitlets (4.3.2) >>>>>> +tws-async (0.5.5) >>>>>> urllib3 (1.15.1) >>>>>> +wcwidth (0.1.7) >>>>>> +webencodings (0.5.1) >>>>>> +widgetsnbextension (3.0.3) >>>>>> wrapt (1.10.10) >>>>>> >>>>>> >>>>>> I just removed html5lib from system(root) , but tha made no >>>>>> difference to the plotting.. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: >>>>>> >>>>>>> hello, >>>>>>> the issue i'm experiencing is local to my laptop ( the other >>>>>>> machines i have run examples just fine). >>>>>>> I described it here https://www.mail-archive.com/p >>>>>>> ython-list at python.org/msg432343.html in details. >>>>>>> i searched around, but none of the proposed workarounds helped. >>>>>>> >>>>>>> Is there a way to enable some-kind of debugging or verbose output >>>>>>> to see what exactly is happening behind the scene? >>>>>>> >>>>>>> Thank you. >>>>>>> AZ >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Matplotlib-users mailing list >>>>>> Matplotlib-users at python.org >>>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>>> >>>>>> >>>>> >>>>> >>>> >> > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > -- > Jody Klymak > http://web.uvic.ca/~jklymak/ > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Wed Nov 8 17:00:43 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Wed, 8 Nov 2017 14:00:43 -0800 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: https://conda.io/docs/index.html > On 8 Nov 2017, at 13:53 PM, Andrew Z wrote: > > Jody, > what do i need to use ? i've been using either dnf or pip3 depending on the situation ( if i want to install in to user's env - > pip3 ir system wide - dnf ). > > On Wed, Nov 8, 2017 at 4:50 PM, Jody Klymak > wrote: > Andrew, > > Can I *strongly* suggest you just use anaconda, unless you have some compelling reason not to? > > It takes care of most of these packaging headaches. I guess I?m ignorant about pycharm, but I?m pretty sure people use it w/ pycharm. > > Cheers, Jody > > >> On 8 Nov 2017, at 13:41 PM, Andrew Z > wrote: >> >> I tried PyQT5 with the same unhappy results: >> >> First, i verified that pyqt5 works - >> >> PyQt5 (5.9.1) - Python bindings for the Qt cross platform UI and application toolkit >> INSTALLED: 5.9 >> LATEST: 5.9.1 >> >> ran http://www.thehackeruniversity.com/2014/01/23/pyqt5-beginner-tutorial/ - exampled worked with no issues. Everything got resolved in pycharm. >> >> next installed the matplot backend: >> python3-matplotlib-qt5.x86_64 >> >> ran examples from here https://pythonspot.com/en/pyqt5-matplotlib/ - and it hanged. >> pycharm is complaining about : >> from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas >> from matplotlib.figure import Figure >> import matplotlib.pyplot as plt >> "can not find reference 'backends' in __init__.py' >> ' unresolved reference backend_qt5agg' >> 'cant reference 'figure' ' >> 'no module named pyplot' >> >> >> >> >> >> On Mon, Nov 6, 2017 at 6:33 PM, Andrew Z > wrote: >> this is what i have installed: >> [az at hp src]$ rpm -qa | grep tkint >> python3-tkinter-3.5.3-6.fc24.x86_64 >> tkinter-2.7.13-2.fc24.x86_64 >> [az at hp src]$ >> >> >> [az at hp src]$ pip3 list | grep tk >> DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. >> >> >> rpm -qa | grep matplot >> python-matplotlib-data-fonts-1.5.2-0.1.rc2.fc24.noarch >> python3-matplotlib-1.5.2-0.1.rc2.fc24.x86_64 >> python3-matplotlib-tk-1.5.2-0.1.rc2.fc24.x86_64 >> python-matplotlib-data-1.5.2-0.1.rc2.fc24.noarch >> >> basically i removed the pip3 installed matplot and felt back to rpm provided in hope to have that config working. >> >> Copy/paste from https://matplotlib.org/gallery/pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py >> [az at hp src]$ which python3.5 >> /usr/bin/python3.5 >> [az at hp src]$ file /usr/bin/python3.5 >> /usr/bin/python3.5: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cc90b759ab34ba1043b3a96779f17eba4c0baf7a, stripped >> [az at hp src]$ >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib.pyplot as plt >> >>> plt.plot([1,2,3,4]) >> >> Terminated >> [az at hp src]$ >> [az at hp src]$ >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib.pyplot as plt >> >>> import matplotlib >> >>> matplotlib.get_backend() >> 'TkAgg' >> >>> exit >> Use exit() or Ctrl-D (i.e. EOF) to exit >> >> removing TKagg from config: >> [az at hp src]$ find / -name matplotlibrc* 2>>/dev/null >> /etc/matplotlibrc >> [az at hp src]$ grep -v ^# /etc/matplotlibrc >> backend : TkAgg >> >> changing to Agg and running the same code: >> >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib >> >>> matplotlib.get_backend() >> 'agg' >> >>> import matplotlib.pyplot as plt >> >>> plt.ylabel('some numbers') >> ^C^Z >> [1]+ Stopped python3.5 >> >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib.pyplot as plt >> >>> plt.plot([1,2,3,4]) >> >> >> I'll stop making any changes to the env now, since i don't want to bring any confusion into the matter. >> thank you for helping out! >> >> >> >> >> >> >> >> >> On Mon, Nov 6, 2017 at 4:48 PM, Andrew Z > wrote: >> >> >backend in your matplotlibrc file to "agg" and it still hung on you? >> >> Yes. I can confirm that >> >> >Some possibilities are >> >...."matplotlib.py" or "pylab.py" or some such, and then start to wonder why their code doesn't work properly. >> >> I used pycharms "scratch files" and typed directly in the interpreter- always same result. I saw this naming issue whileresearching my problem. My file is plot.py and works perfectly fine on any other machine but this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also consistent across machines (minus username) >> >> >Have you looked to see if there are other programs that are running during the import stage? >> >> Im not sure what do you mean? >> I have a xwindow terminal , nothing but Firefox is up.(well a tons of regular background processes). >> >> >> >> >> On Nov 6, 2017 16:18, "Benjamin Root" > wrote: >> Just to make absolutely clear, you set the default backend in your matplotlibrc file to "agg" and it still hung on you? If that is the case, then the problem isn't tkinter. >> >> Some possibilities are >> >> 1) a massive font database that matplotlib is trying to build a cache for >> 2) import of matplotlib from somewhere else unexpected (which would explain pycharm's behavior), and that file/module is misbehaving. We have seen instances in the past where users would name their plotting porting of their code "matplotlib.py" or "pylab.py" or some such, and then start to wonder why their code doesn't work properly. >> >> Have you looked to see if there are other programs that are running during the import stage? One thing matplotlib does for the first import is to create a font cache, and it does this by using some fc-list program, iirc. This can take a long time on some machines that have adobe's font collection installed, for example, but that is usually a Windows thing.... >> >> Ben Root >> >> >> On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z > wrote: >> Tkinter was most likely installed as part of rpm install. >> Backends - not really. I do know that with mpld3and agg the scripts hang. >> Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) and with pip3. >> Today i tried on the office machine (fedora 25). Rpm brings only matplot1.5. >> >> maybe 2 installed locally using pip3 messes with 1.5 leftover or libraries. >> Not sure how to validate this idea though.. >> Probably unrelated: >> In pycharm pyplot is not been recognized as part of matplotlib when i "import matplotlib.pyplot. yet the script doesnt crash on import statement... >> >> >> >> >> >> On Nov 6, 2017 15:13, "Benjamin Root" > wrote: >> How did you install Tkinter? Have you tested any other backends? Does this happen for just the head-less "Agg" backend set as default? >> >> On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z > wrote: >> more relevant information: >> [az at hp src]$ python3.5 >> Python 3.5.3 (default, May 11 2017, 09:10:41) >> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import matplotlib >> >>> matplotlib.__file__ >> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >> >>> matplotlib.get_configdir() >> '/home/az/.config/matplotlib' >> >>> print(matplotlib.__version__) >> 2.1.0 >> >> now if i get the simplest plot : >> >> [az at hp src]$ more ./main1.py >> import matplotlib.pyplot as plt >> print("imported") >> plt.plot([1,2,4,1]) >> print("plot is done") >> plt.show() >> print("show is done") >> >> [az at hp src]$ python3.5 main1.py --verbose-debug >> $HOME=/home/az >> matplotlib data path /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data >> loaded rc file /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc >> matplotlib version 2.1.0 >> verbose.level debug >> interactive is False >> platform is linux >> loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', 'json.scanner', 'os', 'http', 'functools', 'unittest.main', 'numpy.linalg.info ', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', 'selectors', 'numpy.core', 'json.encoder', 'operator', 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info ', 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', 'numpy.fft.info ', 'unittest.signals', 'numpy.lib.npyio', 'grp', 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', '_random', 'email.iterators', '_collections_abc', '__future__', 'email', 'numpy._distributor_init', 'unittest.loader', '_bootlocale', 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info ', 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', 'locale', 'email.errors', 'numpy.core.numerictypes', 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', 'unittest.result', 're', 'http.client', 'numpy.lib.info ', 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', 'string', 'numpy.core.numeric', 'numpy.ma ', 'numpy.fft', 'ctypes', 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', 'builtins'] >> CACHEDIR=/home/az/.cache/matplotlib >> Using fontManager instance from /home/az/.cache/matplotlib/fontList.json >> backend TkAgg version 8.6 >> imported >> ^C >> Hangs at this point with CPU @ 100% >> >> grep -v '#' /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc >> >> The only line is : >> backend : TkAgg >> >> >> [az at hp src]$ gcc --version >> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >> >> I installed using pip3 into --user directory. >> but i also remember that i used dnf to get tkInnter installed: >> rpm -qa | grep tkin >> python3-tkinter-3.5.3-6.fc24.x86_64 >> tkinter-2.7.13-2.fc24.x86_64 >> tix-1:8.4.3-17.fc24.x86_64 >> if i were to compare "pip3 list" between system (root) and the user (az): >> diff -u /tmp/root_pip /tmp/usr_pip >> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >> @@ -1,39 +1,65 @@ >> astroid (1.4.5) >> beautifulsoup4 (4.6.0) >> +bleach (2.1) >> blivet (1.20.3) >> chardet (2.2.1) >> coverage (4.4.1) >> cssselect (0.9.1) >> cupshelpers (1.0) >> +cx-Oracle (6.0.2) >> cycler (0.10.0) >> decorator (4.0.11) >> distro (1.0.2) >> dnf-langpacks (0.15.1) >> +entrypoints (0.2.3) >> fros (1.1) >> -html5lib (0.999) >> +html5lib (1.0b10) >> humanize (0.5.1) >> ib-insync (0.8.5) >> +ibapi (9.73.2) >> iniparse (0.4) >> initial-setup (0.3.40) >> IPy (0.81) >> +ipykernel (4.6.1) >> +ipython (6.2.0) >> +ipython-genutils (0.2.0) >> ipywidgets (7.0.0) >> isc (1.0) >> javapackages (4.6.0) >> +jedi (0.11.0) >> +Jinja2 (2.9.6) >> +jsonschema (2.6.0) >> jupyter (1.0.0) >> +jupyter-client (5.1.0) >> +jupyter-console (5.2.0) >> +jupyter-core (4.3.0) >> langtable (0.0.35) >> lazy-object-proxy (1.2.1) >> lxml (3.7.2) >> +MarkupSafe (1.0) >> +matplotlib (2.1.0) >> +mistune (0.7.4) >> +nbconvert (5.3.1) >> +nbformat (4.4.0) >> +notebook (5.1.0) >> ntplib (0.3.3) >> numpy (1.13.3) >> ordered-set (2.0.0) >> pandas (0.20.3) >> +pandocfilters (1.4.2) >> +parso (0.1.0) >> +pexpect (4.2.1) >> +pickleshare (0.7.4) >> pid (2.0.1) >> Pillow (3.2.0) >> pip (9.0.1) >> +prompt-toolkit (1.0.15) >> +ptyprocess (0.5.2) >> pwquality (1.3.0) >> pycups (1.9.72) >> pycurl (7.43.0) >> pyenchant (1.6.8) >> +Pygments (2.2.0) >> pygobject (3.20.1) >> pygpgme (0.3) >> pyinotify (0.9.6) >> @@ -42,6 +68,7 @@ >> pylint (1.5.6) >> pyparsing (2.2.0) >> pyparted (3.10.7) >> +PyQt5 (5.9) >> PySocks (1.5.6) >> python-augeas (0.5.0) >> python-dateutil (2.6.1) >> @@ -50,6 +77,9 @@ >> pytz (2017.2) >> pyudev (0.21.0) >> pyxdg (0.25) >> +pyzmq (16.0.2) >> +qtconsole (4.3.1) >> +Quamash (0.5.5) >> requests (2.10.0) >> requests-file (1.4) >> requests-ftp (0.3.1) >> @@ -60,11 +90,21 @@ >> sepolicy (1.1) >> setroubleshoot (1.1) >> setuptools (20.1.1) >> +simplegeneric (0.8.1) >> +sip (4.19.3) >> six (1.11.0) >> slip (0.6.4) >> slip.dbus (0.6.4) >> sos (3.2) >> SSSDConfig (1.15.3) >> systemd-python (232) >> +terminado (0.6) >> +testpath (0.3.1) >> +tornado (4.5.2) >> +traitlets (4.3.2) >> +tws-async (0.5.5) >> urllib3 (1.15.1) >> +wcwidth (0.1.7) >> +webencodings (0.5.1) >> +widgetsnbextension (3.0.3) >> wrapt (1.10.10) >> >> >> I just removed html5lib from system(root) , but tha made no difference to the plotting.. >> >> >> >> >> >> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z > wrote: >> hello, >> the issue i'm experiencing is local to my laptop ( the other machines i have run examples just fine). >> I described it here https://www.mail-archive.com/python-list at python.org/msg432343.html in details. >> i searched around, but none of the proposed workarounds helped. >> >> Is there a way to enable some-kind of debugging or verbose output to see what exactly is happening behind the scene? >> >> Thank you. >> AZ >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> >> >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users > > -- > Jody Klymak > http://web.uvic.ca/~jklymak/ > > > > > > -- Jody Klymak http://web.uvic.ca/~jklymak/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Wed Nov 8 16:50:14 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Wed, 8 Nov 2017 13:50:14 -0800 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: Andrew, Can I *strongly* suggest you just use anaconda, unless you have some compelling reason not to? It takes care of most of these packaging headaches. I guess I?m ignorant about pycharm, but I?m pretty sure people use it w/ pycharm. Cheers, Jody > On 8 Nov 2017, at 13:41 PM, Andrew Z wrote: > > I tried PyQT5 with the same unhappy results: > > First, i verified that pyqt5 works - > > PyQt5 (5.9.1) - Python bindings for the Qt cross platform UI and application toolkit > INSTALLED: 5.9 > LATEST: 5.9.1 > > ran http://www.thehackeruniversity.com/2014/01/23/pyqt5-beginner-tutorial/ - exampled worked with no issues. Everything got resolved in pycharm. > > next installed the matplot backend: > python3-matplotlib-qt5.x86_64 > > ran examples from here https://pythonspot.com/en/pyqt5-matplotlib/ - and it hanged. > pycharm is complaining about : > from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas > from matplotlib.figure import Figure > import matplotlib.pyplot as plt > "can not find reference 'backends' in __init__.py' > ' unresolved reference backend_qt5agg' > 'cant reference 'figure' ' > 'no module named pyplot' > > > > > > On Mon, Nov 6, 2017 at 6:33 PM, Andrew Z > wrote: > this is what i have installed: > [az at hp src]$ rpm -qa | grep tkint > python3-tkinter-3.5.3-6.fc24.x86_64 > tkinter-2.7.13-2.fc24.x86_64 > [az at hp src]$ > > > [az at hp src]$ pip3 list | grep tk > DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. > > > rpm -qa | grep matplot > python-matplotlib-data-fonts-1.5.2-0.1.rc2.fc24.noarch > python3-matplotlib-1.5.2-0.1.rc2.fc24.x86_64 > python3-matplotlib-tk-1.5.2-0.1.rc2.fc24.x86_64 > python-matplotlib-data-1.5.2-0.1.rc2.fc24.noarch > > basically i removed the pip3 installed matplot and felt back to rpm provided in hope to have that config working. > > Copy/paste from https://matplotlib.org/gallery/pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py > [az at hp src]$ which python3.5 > /usr/bin/python3.5 > [az at hp src]$ file /usr/bin/python3.5 > /usr/bin/python3.5: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cc90b759ab34ba1043b3a96779f17eba4c0baf7a, stripped > [az at hp src]$ > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib.pyplot as plt > >>> plt.plot([1,2,3,4]) > > Terminated > [az at hp src]$ > [az at hp src]$ > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib.pyplot as plt > >>> import matplotlib > >>> matplotlib.get_backend() > 'TkAgg' > >>> exit > Use exit() or Ctrl-D (i.e. EOF) to exit > > removing TKagg from config: > [az at hp src]$ find / -name matplotlibrc* 2>>/dev/null > /etc/matplotlibrc > [az at hp src]$ grep -v ^# /etc/matplotlibrc > backend : TkAgg > > changing to Agg and running the same code: > > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib > >>> matplotlib.get_backend() > 'agg' > >>> import matplotlib.pyplot as plt > >>> plt.ylabel('some numbers') > ^C^Z > [1]+ Stopped python3.5 > > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib.pyplot as plt > >>> plt.plot([1,2,3,4]) > > > I'll stop making any changes to the env now, since i don't want to bring any confusion into the matter. > thank you for helping out! > > > > > > > > > On Mon, Nov 6, 2017 at 4:48 PM, Andrew Z > wrote: > > >backend in your matplotlibrc file to "agg" and it still hung on you? > > Yes. I can confirm that > > >Some possibilities are > >...."matplotlib.py" or "pylab.py" or some such, and then start to wonder why their code doesn't work properly. > > I used pycharms "scratch files" and typed directly in the interpreter- always same result. I saw this naming issue whileresearching my problem. My file is plot.py and works perfectly fine on any other machine but this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also consistent across machines (minus username) > > >Have you looked to see if there are other programs that are running during the import stage? > > Im not sure what do you mean? > I have a xwindow terminal , nothing but Firefox is up.(well a tons of regular background processes). > > > > > On Nov 6, 2017 16:18, "Benjamin Root" > wrote: > Just to make absolutely clear, you set the default backend in your matplotlibrc file to "agg" and it still hung on you? If that is the case, then the problem isn't tkinter. > > Some possibilities are > > 1) a massive font database that matplotlib is trying to build a cache for > 2) import of matplotlib from somewhere else unexpected (which would explain pycharm's behavior), and that file/module is misbehaving. We have seen instances in the past where users would name their plotting porting of their code "matplotlib.py" or "pylab.py" or some such, and then start to wonder why their code doesn't work properly. > > Have you looked to see if there are other programs that are running during the import stage? One thing matplotlib does for the first import is to create a font cache, and it does this by using some fc-list program, iirc. This can take a long time on some machines that have adobe's font collection installed, for example, but that is usually a Windows thing.... > > Ben Root > > > On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z > wrote: > Tkinter was most likely installed as part of rpm install. > Backends - not really. I do know that with mpld3and agg the scripts hang. > Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) and with pip3. > Today i tried on the office machine (fedora 25). Rpm brings only matplot1.5. > > maybe 2 installed locally using pip3 messes with 1.5 leftover or libraries. > Not sure how to validate this idea though.. > Probably unrelated: > In pycharm pyplot is not been recognized as part of matplotlib when i "import matplotlib.pyplot. yet the script doesnt crash on import statement... > > > > > > On Nov 6, 2017 15:13, "Benjamin Root" > wrote: > How did you install Tkinter? Have you tested any other backends? Does this happen for just the head-less "Agg" backend set as default? > > On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z > wrote: > more relevant information: > [az at hp src]$ python3.5 > Python 3.5.3 (default, May 11 2017, 09:10:41) > [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib > >>> matplotlib.__file__ > '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' > >>> matplotlib.get_configdir() > '/home/az/.config/matplotlib' > >>> print(matplotlib.__version__) > 2.1.0 > > now if i get the simplest plot : > > [az at hp src]$ more ./main1.py > import matplotlib.pyplot as plt > print("imported") > plt.plot([1,2,4,1]) > print("plot is done") > plt.show() > print("show is done") > > [az at hp src]$ python3.5 main1.py --verbose-debug > $HOME=/home/az > matplotlib data path /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data > loaded rc file /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc > matplotlib version 2.1.0 > verbose.level debug > interactive is False > platform is linux > loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', 'json.scanner', 'os', 'http', 'functools', 'unittest.main', 'numpy.linalg.info ', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', 'selectors', 'numpy.core', 'json.encoder', 'operator', 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', 'numpy.lib', '_thread', 'time', '_frozen_importlib', 'numpy.core.info ', 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', 'numpy.fft.info ', 'unittest.signals', 'numpy.lib.npyio', 'grp', 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', '_random', 'email.iterators', '_collections_abc', '__future__', 'email', 'numpy._distributor_init', 'unittest.loader', '_bootlocale', 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info ', 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', 'locale', 'email.errors', 'numpy.core.numerictypes', 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', 'unittest.result', 're', 'http.client', 'numpy.lib.info ', 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', 'string', 'numpy.core.numeric', 'numpy.ma ', 'numpy.fft', 'ctypes', 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', 'builtins'] > CACHEDIR=/home/az/.cache/matplotlib > Using fontManager instance from /home/az/.cache/matplotlib/fontList.json > backend TkAgg version 8.6 > imported > ^C > Hangs at this point with CPU @ 100% > > grep -v '#' /home/az/.local/lib/python3.5/site-packages/matplotlib/mpl-data/matplotlibrc > > The only line is : > backend : TkAgg > > > [az at hp src]$ gcc --version > gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) > > I installed using pip3 into --user directory. > but i also remember that i used dnf to get tkInnter installed: > rpm -qa | grep tkin > python3-tkinter-3.5.3-6.fc24.x86_64 > tkinter-2.7.13-2.fc24.x86_64 > tix-1:8.4.3-17.fc24.x86_64 > if i were to compare "pip3 list" between system (root) and the user (az): > diff -u /tmp/root_pip /tmp/usr_pip > --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 > +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 > @@ -1,39 +1,65 @@ > astroid (1.4.5) > beautifulsoup4 (4.6.0) > +bleach (2.1) > blivet (1.20.3) > chardet (2.2.1) > coverage (4.4.1) > cssselect (0.9.1) > cupshelpers (1.0) > +cx-Oracle (6.0.2) > cycler (0.10.0) > decorator (4.0.11) > distro (1.0.2) > dnf-langpacks (0.15.1) > +entrypoints (0.2.3) > fros (1.1) > -html5lib (0.999) > +html5lib (1.0b10) > humanize (0.5.1) > ib-insync (0.8.5) > +ibapi (9.73.2) > iniparse (0.4) > initial-setup (0.3.40) > IPy (0.81) > +ipykernel (4.6.1) > +ipython (6.2.0) > +ipython-genutils (0.2.0) > ipywidgets (7.0.0) > isc (1.0) > javapackages (4.6.0) > +jedi (0.11.0) > +Jinja2 (2.9.6) > +jsonschema (2.6.0) > jupyter (1.0.0) > +jupyter-client (5.1.0) > +jupyter-console (5.2.0) > +jupyter-core (4.3.0) > langtable (0.0.35) > lazy-object-proxy (1.2.1) > lxml (3.7.2) > +MarkupSafe (1.0) > +matplotlib (2.1.0) > +mistune (0.7.4) > +nbconvert (5.3.1) > +nbformat (4.4.0) > +notebook (5.1.0) > ntplib (0.3.3) > numpy (1.13.3) > ordered-set (2.0.0) > pandas (0.20.3) > +pandocfilters (1.4.2) > +parso (0.1.0) > +pexpect (4.2.1) > +pickleshare (0.7.4) > pid (2.0.1) > Pillow (3.2.0) > pip (9.0.1) > +prompt-toolkit (1.0.15) > +ptyprocess (0.5.2) > pwquality (1.3.0) > pycups (1.9.72) > pycurl (7.43.0) > pyenchant (1.6.8) > +Pygments (2.2.0) > pygobject (3.20.1) > pygpgme (0.3) > pyinotify (0.9.6) > @@ -42,6 +68,7 @@ > pylint (1.5.6) > pyparsing (2.2.0) > pyparted (3.10.7) > +PyQt5 (5.9) > PySocks (1.5.6) > python-augeas (0.5.0) > python-dateutil (2.6.1) > @@ -50,6 +77,9 @@ > pytz (2017.2) > pyudev (0.21.0) > pyxdg (0.25) > +pyzmq (16.0.2) > +qtconsole (4.3.1) > +Quamash (0.5.5) > requests (2.10.0) > requests-file (1.4) > requests-ftp (0.3.1) > @@ -60,11 +90,21 @@ > sepolicy (1.1) > setroubleshoot (1.1) > setuptools (20.1.1) > +simplegeneric (0.8.1) > +sip (4.19.3) > six (1.11.0) > slip (0.6.4) > slip.dbus (0.6.4) > sos (3.2) > SSSDConfig (1.15.3) > systemd-python (232) > +terminado (0.6) > +testpath (0.3.1) > +tornado (4.5.2) > +traitlets (4.3.2) > +tws-async (0.5.5) > urllib3 (1.15.1) > +wcwidth (0.1.7) > +webencodings (0.5.1) > +widgetsnbextension (3.0.3) > wrapt (1.10.10) > > > I just removed html5lib from system(root) , but tha made no difference to the plotting.. > > > > > > On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z > wrote: > hello, > the issue i'm experiencing is local to my laptop ( the other machines i have run examples just fine). > I described it here https://www.mail-archive.com/python-list at python.org/msg432343.html in details. > i searched around, but none of the proposed workarounds helped. > > Is there a way to enable some-kind of debugging or verbose output to see what exactly is happening behind the scene? > > Thank you. > AZ > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -- Jody Klymak http://web.uvic.ca/~jklymak/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Wed Nov 8 17:43:07 2017 From: formisc at gmail.com (Andrew Z) Date: Wed, 8 Nov 2017 17:43:07 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: i'll take a look @ conda. Thank you. Meanwhile. i resolved the problem with "missing" plot, backend packages from matplot in pycharm - the /usr/lib64/python3.5 was absent from the pycharm's config. now i don't have any warnings from from pycharm - "what a charm!" (sorry, couldn't resists) . But the example still won't work. // another Tito's shot maybe due... On Wed, Nov 8, 2017 at 5:00 PM, Jody Klymak wrote: > https://conda.io/docs/index.html > > > > On 8 Nov 2017, at 13:53 PM, Andrew Z wrote: > > Jody, > what do i need to use ? i've been using either dnf or pip3 depending on > the situation ( if i want to install in to user's env - > pip3 ir system > wide - dnf ). > > On Wed, Nov 8, 2017 at 4:50 PM, Jody Klymak wrote: > >> Andrew, >> >> Can I *strongly* suggest you just use anaconda, unless you have some >> compelling reason not to? >> >> It takes care of most of these packaging headaches. I guess I?m ignorant >> about pycharm, but I?m pretty sure people use it w/ pycharm. >> >> Cheers, Jody >> >> >> On 8 Nov 2017, at 13:41 PM, Andrew Z wrote: >> >> I tried PyQT5 with the same unhappy results: >> >> First, i verified that pyqt5 works - >> >> PyQt5 (5.9.1) - Python bindings for the Qt cross >> platform UI and application toolkit >> INSTALLED: 5.9 >> LATEST: 5.9.1 >> >> ran http://www.thehackeruniversity.com/2014/01/23/pyqt5- >> beginner-tutorial/ - exampled worked with no issues. Everything got >> resolved in pycharm. >> >> next installed the matplot backend: >> python3-matplotlib-qt5.x86_64 >> >> ran examples from here https://pythonspot.com/en/pyqt5-matplotlib/ - and >> it hanged. >> pycharm is complaining about : >> >> from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas >> from matplotlib.figure import Figure >> import matplotlib.pyplot as plt >> >> "can not find reference 'backends' in __init__.py' >> ' unresolved reference backend_qt5agg' >> 'cant reference 'figure' ' >> 'no module named pyplot' >> >> >> >> >> >> On Mon, Nov 6, 2017 at 6:33 PM, Andrew Z wrote: >> >>> this is what i have installed: >>> [az at hp src]$ rpm -qa | grep tkint >>> python3-tkinter-3.5.3-6.fc24.x86_64 >>> tkinter-2.7.13-2.fc24.x86_64 >>> [az at hp src]$ >>> >>> >>> [az at hp src]$ pip3 list | grep tk >>> DEPRECATION: The default format will switch to columns in the future. >>> You can use --format=(legacy|columns) (or define a format=(legacy|columns) >>> in your pip.conf under the [list] section) to disable this warning. >>> >>> >>> rpm -qa | grep matplot >>> python-matplotlib-data-fonts-1.5.2-0.1.rc2.fc24.noarch >>> python3-matplotlib-1.5.2-0.1.rc2.fc24.x86_64 >>> python3-matplotlib-tk-1.5.2-0.1.rc2.fc24.x86_64 >>> python-matplotlib-data-1.5.2-0.1.rc2.fc24.noarch >>> >>> basically i removed the pip3 installed matplot and felt back to rpm >>> provided in hope to have that config working. >>> >>> Copy/paste from https://matplotlib.org/gallery >>> /pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py >>> [az at hp src]$ which python3.5 >>> /usr/bin/python3.5 >>> [az at hp src]$ file /usr/bin/python3.5 >>> /usr/bin/python3.5: ELF 64-bit LSB shared object, x86-64, version 1 >>> (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for >>> GNU/Linux 2.6.32, BuildID[sha1]=cc90b759ab34ba1043b3a96779f17eba4c0baf7a, >>> stripped >>> [az at hp src]$ >>> [az at hp src]$ python3.5 >>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> import matplotlib.pyplot as plt >>> >>> plt.plot([1,2,3,4]) >>> >>> Terminated >>> [az at hp src]$ >>> [az at hp src]$ >>> [az at hp src]$ python3.5 >>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> import matplotlib.pyplot as plt >>> >>> import matplotlib >>> >>> matplotlib.get_backend() >>> 'TkAgg' >>> >>> exit >>> Use exit() or Ctrl-D (i.e. EOF) to exit >>> >>> removing TKagg from config: >>> [az at hp src]$ find / -name matplotlibrc* 2>>/dev/null >>> /etc/matplotlibrc >>> [az at hp src]$ grep -v ^# /etc/matplotlibrc >>> backend : TkAgg >>> >>> changing to Agg and running the same code: >>> >>> [az at hp src]$ python3.5 >>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> import matplotlib >>> >>> matplotlib.get_backend() >>> 'agg' >>> >>> import matplotlib.pyplot as plt >>> >>> plt.ylabel('some numbers') >>> ^C^Z >>> [1]+ Stopped python3.5 >>> >>> [az at hp src]$ python3.5 >>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> import matplotlib.pyplot as plt >>> >>> plt.plot([1,2,3,4]) >>> >>> >>> I'll stop making any changes to the env now, since i don't want to bring >>> any confusion into the matter. >>> thank you for helping out! >>> >>> >>> >>> >>> >>> >>> >>> >>> On Mon, Nov 6, 2017 at 4:48 PM, Andrew Z wrote: >>> >>>> >>>> >backend in your matplotlibrc file to "agg" and it still hung on you? >>>> >>>> Yes. I can confirm that >>>> >>>> >Some possibilities are >>>> >...."matplotlib.py" or "pylab.py" or some such, and then start to >>>> wonder why their code doesn't work properly. >>>> >>>> I used pycharms "scratch files" and typed directly in the interpreter- >>>> always same result. I saw this naming issue whileresearching my problem. My >>>> file is plot.py and works perfectly fine on any other machine but >>>> this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also >>>> consistent across machines (minus username) >>>> >>>> >Have you looked to see if there are other programs that are running >>>> during the import stage? >>>> >>>> Im not sure what do you mean? >>>> I have a xwindow terminal , nothing but Firefox is up.(well a tons of >>>> regular background processes). >>>> >>>> >>>> >>>> >>>> On Nov 6, 2017 16:18, "Benjamin Root" wrote: >>>> >>>>> Just to make absolutely clear, you set the default backend in your >>>>> matplotlibrc file to "agg" and it still hung on you? If that is the case, >>>>> then the problem isn't tkinter. >>>>> >>>>> Some possibilities are >>>>> >>>>> 1) a massive font database that matplotlib is trying to build a cache >>>>> for >>>>> 2) import of matplotlib from somewhere else unexpected (which would >>>>> explain pycharm's behavior), and that file/module is misbehaving. We have >>>>> seen instances in the past where users would name their plotting porting of >>>>> their code "matplotlib.py" or "pylab.py" or some such, and then start to >>>>> wonder why their code doesn't work properly. >>>>> >>>>> Have you looked to see if there are other programs that are running >>>>> during the import stage? One thing matplotlib does for the first import is >>>>> to create a font cache, and it does this by using some fc-list program, >>>>> iirc. This can take a long time on some machines that have adobe's font >>>>> collection installed, for example, but that is usually a Windows thing.... >>>>> >>>>> Ben Root >>>>> >>>>> >>>>> On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z wrote: >>>>> >>>>>> Tkinter was most likely installed as part of rpm install. >>>>>> Backends - not really. I do know that with mpld3and agg the scripts >>>>>> hang. >>>>>> Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) >>>>>> and with pip3. >>>>>> Today i tried on the office machine (fedora 25). Rpm brings only >>>>>> matplot1.5. >>>>>> >>>>>> maybe 2 installed locally using pip3 messes with 1.5 leftover or >>>>>> libraries. >>>>>> Not sure how to validate this idea though.. >>>>>> Probably unrelated: >>>>>> In pycharm pyplot is not been recognized as part of matplotlib when i >>>>>> "import matplotlib.pyplot. yet the script doesnt crash on import >>>>>> statement... >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Nov 6, 2017 15:13, "Benjamin Root" wrote: >>>>>> >>>>>> How did you install Tkinter? Have you tested any other backends? Does >>>>>> this happen for just the head-less "Agg" backend set as default? >>>>>> >>>>>> On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: >>>>>> >>>>>>> more relevant information: >>>>>>> [az at hp src]$ python3.5 >>>>>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>>>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>>>>> Type "help", "copyright", "credits" or "license" for more >>>>>>> information. >>>>>>> >>> import matplotlib >>>>>>> >>> matplotlib.__file__ >>>>>>> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__init__.py' >>>>>>> >>> matplotlib.get_configdir() >>>>>>> '/home/az/.config/matplotlib' >>>>>>> >>> print(matplotlib.__version__) >>>>>>> 2.1.0 >>>>>>> >>>>>>> now if i get the simplest plot : >>>>>>> >>>>>>> [az at hp src]$ more ./main1.py >>>>>>> import matplotlib.pyplot as plt >>>>>>> print("imported") >>>>>>> plt.plot([1,2,4,1]) >>>>>>> print("plot is done") >>>>>>> plt.show() >>>>>>> print("show is done") >>>>>>> >>>>>>> [az at hp src]$ python3.5 main1.py --verbose-debug >>>>>>> $HOME=/home/az >>>>>>> matplotlib data path /home/az/.local/lib/python3.5/ >>>>>>> site-packages/matplotlib/mpl-data >>>>>>> loaded rc file /home/az/.local/lib/python3.5/ >>>>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>>>> matplotlib version 2.1.0 >>>>>>> verbose.level debug >>>>>>> interactive is False >>>>>>> platform is linux >>>>>>> loaded modules: ['_locale', 'urllib.request', >>>>>>> 'numpy.lib.shape_base', 'numpy.matrixlib', 'ipaddress', 'hashlib', >>>>>>> 'collections', 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', >>>>>>> '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', >>>>>>> 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', >>>>>>> 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', >>>>>>> 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', >>>>>>> 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', >>>>>>> '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', >>>>>>> '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', >>>>>>> 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', >>>>>>> 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', >>>>>>> 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' >>>>>>> numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', >>>>>>> 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', >>>>>>> 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', >>>>>>> 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', >>>>>>> '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', >>>>>>> 'selectors', 'numpy.core', 'json.encoder', 'operator', >>>>>>> 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', >>>>>>> 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', >>>>>>> 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', >>>>>>> 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', >>>>>>> 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', >>>>>>> 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', >>>>>>> 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', >>>>>>> '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', >>>>>>> 'numpy.lib', '_thread', 'time', '_frozen_importlib', ' >>>>>>> numpy.core.info', 'numpy.core.multiarray', 'math', '_opcode', >>>>>>> 'urllib.parse', 'distutils.sysconfig', 'ntpath', 'argparse', 'types', >>>>>>> 'sre_compile', 'glob', '__main__', 'email._encoded_words', 'socket', >>>>>>> '_struct', 'numpy.fft.info', 'unittest.signals', 'numpy.lib.npyio', >>>>>>> 'grp', 'urllib.error', '_io', 'numpy._globals', 'gettext', >>>>>>> 'numpy.compat.py3k', 'distutils', 'email.charset', 'ast', >>>>>>> 'numpy.lib.function_base', 'uu', 'encodings', 'urllib', >>>>>>> 'numpy.lib.twodim_base', 'encodings.latin_1', 'tempfile', >>>>>>> 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', 'os.path', >>>>>>> '_imp', 'email.base64mime', 'email.message', 'email.header', 'opcode', >>>>>>> 'encodings.utf_8', 'reprlib', '_stat', '_warnings', 'email.feedparser', >>>>>>> 'numpy.testing.utils', 'numpy.lib.utils', 'genericpath', >>>>>>> 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', '_compression', >>>>>>> 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', 'sysconfig', >>>>>>> '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', '_random', >>>>>>> 'email.iterators', '_collections_abc', '__future__', 'email', >>>>>>> 'numpy._distributor_init', 'unittest.loader', '_bootlocale', >>>>>>> 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', >>>>>>> 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', >>>>>>> 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', >>>>>>> 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', >>>>>>> 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', >>>>>>> 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', >>>>>>> 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', >>>>>>> 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', >>>>>>> 'locale', 'email.errors', 'numpy.core.numerictypes', >>>>>>> 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', >>>>>>> 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', >>>>>>> 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', >>>>>>> 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', >>>>>>> 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', >>>>>>> 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', >>>>>>> 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', >>>>>>> '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', >>>>>>> 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', >>>>>>> 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', >>>>>>> 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', >>>>>>> 'unittest.result', 're', 'http.client', 'numpy.lib.info', >>>>>>> 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', >>>>>>> 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', >>>>>>> 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', >>>>>>> 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', '_datetime', >>>>>>> 'builtins'] >>>>>>> CACHEDIR=/home/az/.cache/matplotlib >>>>>>> Using fontManager instance from /home/az/.cache/matplotlib/fon >>>>>>> tList.json >>>>>>> backend TkAgg version 8.6 >>>>>>> imported >>>>>>> ^C >>>>>>> Hangs at this point with CPU @ 100% >>>>>>> >>>>>>> grep -v '#' /home/az/.local/lib/python3.5/ >>>>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>>>> >>>>>>> The only line is : >>>>>>> backend : TkAgg >>>>>>> >>>>>>> >>>>>>> [az at hp src]$ gcc --version >>>>>>> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >>>>>>> >>>>>>> I installed using pip3 into --user directory. >>>>>>> but i also remember that i used dnf to get tkInnter installed: >>>>>>> rpm -qa | grep tkin >>>>>>> python3-tkinter-3.5.3-6.fc24.x86_64 >>>>>>> tkinter-2.7.13-2.fc24.x86_64 >>>>>>> tix-1:8.4.3-17.fc24.x86_64 >>>>>>> if i were to compare "pip3 list" between system (root) and the user >>>>>>> (az): >>>>>>> diff -u /tmp/root_pip /tmp/usr_pip >>>>>>> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >>>>>>> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >>>>>>> @@ -1,39 +1,65 @@ >>>>>>> astroid (1.4.5) >>>>>>> beautifulsoup4 (4.6.0) >>>>>>> +bleach (2.1) >>>>>>> blivet (1.20.3) >>>>>>> chardet (2.2.1) >>>>>>> coverage (4.4.1) >>>>>>> cssselect (0.9.1) >>>>>>> cupshelpers (1.0) >>>>>>> +cx-Oracle (6.0.2) >>>>>>> cycler (0.10.0) >>>>>>> decorator (4.0.11) >>>>>>> distro (1.0.2) >>>>>>> dnf-langpacks (0.15.1) >>>>>>> +entrypoints (0.2.3) >>>>>>> fros (1.1) >>>>>>> -html5lib (0.999) >>>>>>> +html5lib (1.0b10) >>>>>>> humanize (0.5.1) >>>>>>> ib-insync (0.8.5) >>>>>>> +ibapi (9.73.2) >>>>>>> iniparse (0.4) >>>>>>> initial-setup (0.3.40) >>>>>>> IPy (0.81) >>>>>>> +ipykernel (4.6.1) >>>>>>> +ipython (6.2.0) >>>>>>> +ipython-genutils (0.2.0) >>>>>>> ipywidgets (7.0.0) >>>>>>> isc (1.0) >>>>>>> javapackages (4.6.0) >>>>>>> +jedi (0.11.0) >>>>>>> +Jinja2 (2.9.6) >>>>>>> +jsonschema (2.6.0) >>>>>>> jupyter (1.0.0) >>>>>>> +jupyter-client (5.1.0) >>>>>>> +jupyter-console (5.2.0) >>>>>>> +jupyter-core (4.3.0) >>>>>>> langtable (0.0.35) >>>>>>> lazy-object-proxy (1.2.1) >>>>>>> lxml (3.7.2) >>>>>>> +MarkupSafe (1.0) >>>>>>> +matplotlib (2.1.0) >>>>>>> +mistune (0.7.4) >>>>>>> +nbconvert (5.3.1) >>>>>>> +nbformat (4.4.0) >>>>>>> +notebook (5.1.0) >>>>>>> ntplib (0.3.3) >>>>>>> numpy (1.13.3) >>>>>>> ordered-set (2.0.0) >>>>>>> pandas (0.20.3) >>>>>>> +pandocfilters (1.4.2) >>>>>>> +parso (0.1.0) >>>>>>> +pexpect (4.2.1) >>>>>>> +pickleshare (0.7.4) >>>>>>> pid (2.0.1) >>>>>>> Pillow (3.2.0) >>>>>>> pip (9.0.1) >>>>>>> +prompt-toolkit (1.0.15) >>>>>>> +ptyprocess (0.5.2) >>>>>>> pwquality (1.3.0) >>>>>>> pycups (1.9.72) >>>>>>> pycurl (7.43.0) >>>>>>> pyenchant (1.6.8) >>>>>>> +Pygments (2.2.0) >>>>>>> pygobject (3.20.1) >>>>>>> pygpgme (0.3) >>>>>>> pyinotify (0.9.6) >>>>>>> @@ -42,6 +68,7 @@ >>>>>>> pylint (1.5.6) >>>>>>> pyparsing (2.2.0) >>>>>>> pyparted (3.10.7) >>>>>>> +PyQt5 (5.9) >>>>>>> PySocks (1.5.6) >>>>>>> python-augeas (0.5.0) >>>>>>> python-dateutil (2.6.1) >>>>>>> @@ -50,6 +77,9 @@ >>>>>>> pytz (2017.2) >>>>>>> pyudev (0.21.0) >>>>>>> pyxdg (0.25) >>>>>>> +pyzmq (16.0.2) >>>>>>> +qtconsole (4.3.1) >>>>>>> +Quamash (0.5.5) >>>>>>> requests (2.10.0) >>>>>>> requests-file (1.4) >>>>>>> requests-ftp (0.3.1) >>>>>>> @@ -60,11 +90,21 @@ >>>>>>> sepolicy (1.1) >>>>>>> setroubleshoot (1.1) >>>>>>> setuptools (20.1.1) >>>>>>> +simplegeneric (0.8.1) >>>>>>> +sip (4.19.3) >>>>>>> six (1.11.0) >>>>>>> slip (0.6.4) >>>>>>> slip.dbus (0.6.4) >>>>>>> sos (3.2) >>>>>>> SSSDConfig (1.15.3) >>>>>>> systemd-python (232) >>>>>>> +terminado (0.6) >>>>>>> +testpath (0.3.1) >>>>>>> +tornado (4.5.2) >>>>>>> +traitlets (4.3.2) >>>>>>> +tws-async (0.5.5) >>>>>>> urllib3 (1.15.1) >>>>>>> +wcwidth (0.1.7) >>>>>>> +webencodings (0.5.1) >>>>>>> +widgetsnbextension (3.0.3) >>>>>>> wrapt (1.10.10) >>>>>>> >>>>>>> >>>>>>> I just removed html5lib from system(root) , but tha made no >>>>>>> difference to the plotting.. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z wrote: >>>>>>> >>>>>>>> hello, >>>>>>>> the issue i'm experiencing is local to my laptop ( the other >>>>>>>> machines i have run examples just fine). >>>>>>>> I described it here https://www.mail-archive.com/p >>>>>>>> ython-list at python.org/msg432343.html in details. >>>>>>>> i searched around, but none of the proposed workarounds helped. >>>>>>>> >>>>>>>> Is there a way to enable some-kind of debugging or verbose output >>>>>>>> to see what exactly is happening behind the scene? >>>>>>>> >>>>>>>> Thank you. >>>>>>>> AZ >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Matplotlib-users mailing list >>>>>>> Matplotlib-users at python.org >>>>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> >> -- >> Jody Klymak >> http://web.uvic.ca/~jklymak/ >> >> >> >> >> >> > > -- > Jody Klymak > http://web.uvic.ca/~jklymak/ > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From formisc at gmail.com Wed Nov 8 18:10:03 2017 From: formisc at gmail.com (Andrew Z) Date: Wed, 8 Nov 2017 18:10:03 -0500 Subject: [Matplotlib-users] TkAgg won't plot - how to debug? In-Reply-To: References: Message-ID: another take: rebuild of the font cache - recreated ~/.cache/matplotlib ran : more ./main.py import matplotlib import matplotlib.pyplot as plt print(matplotlib.rcParams['backend']) plt.plot([1,2,3],[5,7,4]) plt.show(block=False) # plt.show() [az at hp src]$ [az at hp src]$ [az at hp src]$ python3.5 main.py /usr/lib64/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') /usr/lib64/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') TkAgg the content of the ~/.cache/matplotlib: [az at hp matplotlib]$ pwd /home/az/.cache/matplotlib [az at hp matplotlib]$ ls -l total 44 -rw-rw-r--. 1 az az 39870 Nov 8 18:00 fontList.py3k.cache drwxrwxr-x. 2 az az 4096 Nov 8 18:00 tex.cache btw, when i run "fc-list" i see fonts only from /usr/share. Is this expected ? On Wed, Nov 8, 2017 at 5:43 PM, Andrew Z wrote: > i'll take a look @ conda. Thank you. > > Meanwhile. i resolved the problem with "missing" plot, backend packages > from matplot in pycharm - the /usr/lib64/python3.5 was absent from the > pycharm's config. > now i don't have any warnings from from pycharm - "what a charm!" (sorry, > couldn't resists) . But the example still won't work. > > // another Tito's shot maybe due... > > > > On Wed, Nov 8, 2017 at 5:00 PM, Jody Klymak wrote: > >> https://conda.io/docs/index.html >> >> >> >> On 8 Nov 2017, at 13:53 PM, Andrew Z wrote: >> >> Jody, >> what do i need to use ? i've been using either dnf or pip3 depending on >> the situation ( if i want to install in to user's env - > pip3 ir system >> wide - dnf ). >> >> On Wed, Nov 8, 2017 at 4:50 PM, Jody Klymak wrote: >> >>> Andrew, >>> >>> Can I *strongly* suggest you just use anaconda, unless you have some >>> compelling reason not to? >>> >>> It takes care of most of these packaging headaches. I guess I?m >>> ignorant about pycharm, but I?m pretty sure people use it w/ pycharm. >>> >>> Cheers, Jody >>> >>> >>> On 8 Nov 2017, at 13:41 PM, Andrew Z wrote: >>> >>> I tried PyQT5 with the same unhappy results: >>> >>> First, i verified that pyqt5 works - >>> >>> PyQt5 (5.9.1) - Python bindings for the Qt cross >>> platform UI and application toolkit >>> INSTALLED: 5.9 >>> LATEST: 5.9.1 >>> >>> ran http://www.thehackeruniversity.com/2014/01/23/pyqt5-beginner >>> -tutorial/ - exampled worked with no issues. Everything got resolved >>> in pycharm. >>> >>> next installed the matplot backend: >>> python3-matplotlib-qt5.x86_64 >>> >>> ran examples from here https://pythonspot.com/en/pyqt5-matplotlib/ - >>> and it hanged. >>> pycharm is complaining about : >>> >>> from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas >>> from matplotlib.figure import Figure >>> import matplotlib.pyplot as plt >>> >>> "can not find reference 'backends' in __init__.py' >>> ' unresolved reference backend_qt5agg' >>> 'cant reference 'figure' ' >>> 'no module named pyplot' >>> >>> >>> >>> >>> >>> On Mon, Nov 6, 2017 at 6:33 PM, Andrew Z wrote: >>> >>>> this is what i have installed: >>>> [az at hp src]$ rpm -qa | grep tkint >>>> python3-tkinter-3.5.3-6.fc24.x86_64 >>>> tkinter-2.7.13-2.fc24.x86_64 >>>> [az at hp src]$ >>>> >>>> >>>> [az at hp src]$ pip3 list | grep tk >>>> DEPRECATION: The default format will switch to columns in the future. >>>> You can use --format=(legacy|columns) (or define a format=(legacy|columns) >>>> in your pip.conf under the [list] section) to disable this warning. >>>> >>>> >>>> rpm -qa | grep matplot >>>> python-matplotlib-data-fonts-1.5.2-0.1.rc2.fc24.noarch >>>> python3-matplotlib-1.5.2-0.1.rc2.fc24.x86_64 >>>> python3-matplotlib-tk-1.5.2-0.1.rc2.fc24.x86_64 >>>> python-matplotlib-data-1.5.2-0.1.rc2.fc24.noarch >>>> >>>> basically i removed the pip3 installed matplot and felt back to rpm >>>> provided in hope to have that config working. >>>> >>>> Copy/paste from https://matplotlib.org/gallery >>>> /pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py >>>> [az at hp src]$ which python3.5 >>>> /usr/bin/python3.5 >>>> [az at hp src]$ file /usr/bin/python3.5 >>>> /usr/bin/python3.5: ELF 64-bit LSB shared object, x86-64, version 1 >>>> (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for >>>> GNU/Linux 2.6.32, BuildID[sha1]=cc90b759ab34ba1043b3a96779f17eba4c0baf7a, >>>> stripped >>>> [az at hp src]$ >>>> [az at hp src]$ python3.5 >>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>> Type "help", "copyright", "credits" or "license" for more information. >>>> >>> import matplotlib.pyplot as plt >>>> >>> plt.plot([1,2,3,4]) >>>> >>>> Terminated >>>> [az at hp src]$ >>>> [az at hp src]$ >>>> [az at hp src]$ python3.5 >>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>> Type "help", "copyright", "credits" or "license" for more information. >>>> >>> import matplotlib.pyplot as plt >>>> >>> import matplotlib >>>> >>> matplotlib.get_backend() >>>> 'TkAgg' >>>> >>> exit >>>> Use exit() or Ctrl-D (i.e. EOF) to exit >>>> >>>> removing TKagg from config: >>>> [az at hp src]$ find / -name matplotlibrc* 2>>/dev/null >>>> /etc/matplotlibrc >>>> [az at hp src]$ grep -v ^# /etc/matplotlibrc >>>> backend : TkAgg >>>> >>>> changing to Agg and running the same code: >>>> >>>> [az at hp src]$ python3.5 >>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>> Type "help", "copyright", "credits" or "license" for more information. >>>> >>> import matplotlib >>>> >>> matplotlib.get_backend() >>>> 'agg' >>>> >>> import matplotlib.pyplot as plt >>>> >>> plt.ylabel('some numbers') >>>> ^C^Z >>>> [1]+ Stopped python3.5 >>>> >>>> [az at hp src]$ python3.5 >>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>> Type "help", "copyright", "credits" or "license" for more information. >>>> >>> import matplotlib.pyplot as plt >>>> >>> plt.plot([1,2,3,4]) >>>> >>>> >>>> I'll stop making any changes to the env now, since i don't want to >>>> bring any confusion into the matter. >>>> thank you for helping out! >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Mon, Nov 6, 2017 at 4:48 PM, Andrew Z wrote: >>>> >>>>> >>>>> >backend in your matplotlibrc file to "agg" and it still hung on you? >>>>> >>>>> Yes. I can confirm that >>>>> >>>>> >Some possibilities are >>>>> >...."matplotlib.py" or "pylab.py" or some such, and then start to >>>>> wonder why their code doesn't work properly. >>>>> >>>>> I used pycharms "scratch files" and typed directly in the interpreter- >>>>> always same result. I saw this naming issue whileresearching my problem. My >>>>> file is plot.py and works perfectly fine on any other machine but >>>>> this.(drives me mad, honestly). Directory is /home/az/work/nja/src. Also >>>>> consistent across machines (minus username) >>>>> >>>>> >Have you looked to see if there are other programs that are running >>>>> during the import stage? >>>>> >>>>> Im not sure what do you mean? >>>>> I have a xwindow terminal , nothing but Firefox is up.(well a tons of >>>>> regular background processes). >>>>> >>>>> >>>>> >>>>> >>>>> On Nov 6, 2017 16:18, "Benjamin Root" wrote: >>>>> >>>>>> Just to make absolutely clear, you set the default backend in your >>>>>> matplotlibrc file to "agg" and it still hung on you? If that is the case, >>>>>> then the problem isn't tkinter. >>>>>> >>>>>> Some possibilities are >>>>>> >>>>>> 1) a massive font database that matplotlib is trying to build a cache >>>>>> for >>>>>> 2) import of matplotlib from somewhere else unexpected (which would >>>>>> explain pycharm's behavior), and that file/module is misbehaving. We have >>>>>> seen instances in the past where users would name their plotting porting of >>>>>> their code "matplotlib.py" or "pylab.py" or some such, and then start to >>>>>> wonder why their code doesn't work properly. >>>>>> >>>>>> Have you looked to see if there are other programs that are running >>>>>> during the import stage? One thing matplotlib does for the first import is >>>>>> to create a font cache, and it does this by using some fc-list program, >>>>>> iirc. This can take a long time on some machines that have adobe's font >>>>>> collection installed, for example, but that is usually a Windows thing.... >>>>>> >>>>>> Ben Root >>>>>> >>>>>> >>>>>> On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z wrote: >>>>>> >>>>>>> Tkinter was most likely installed as part of rpm install. >>>>>>> Backends - not really. I do know that with mpld3and agg the scripts >>>>>>> hang. >>>>>>> Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) >>>>>>> and with pip3. >>>>>>> Today i tried on the office machine (fedora 25). Rpm brings only >>>>>>> matplot1.5. >>>>>>> >>>>>>> maybe 2 installed locally using pip3 messes with 1.5 leftover or >>>>>>> libraries. >>>>>>> Not sure how to validate this idea though.. >>>>>>> Probably unrelated: >>>>>>> In pycharm pyplot is not been recognized as part of matplotlib when >>>>>>> i "import matplotlib.pyplot. yet the script doesnt crash on import >>>>>>> statement... >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Nov 6, 2017 15:13, "Benjamin Root" wrote: >>>>>>> >>>>>>> How did you install Tkinter? Have you tested any other backends? >>>>>>> Does this happen for just the head-less "Agg" backend set as default? >>>>>>> >>>>>>> On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z wrote: >>>>>>> >>>>>>>> more relevant information: >>>>>>>> [az at hp src]$ python3.5 >>>>>>>> Python 3.5.3 (default, May 11 2017, 09:10:41) >>>>>>>> [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux >>>>>>>> Type "help", "copyright", "credits" or "license" for more >>>>>>>> information. >>>>>>>> >>> import matplotlib >>>>>>>> >>> matplotlib.__file__ >>>>>>>> '/home/az/.local/lib/python3.5/site-packages/matplotlib/__in >>>>>>>> it__.py' >>>>>>>> >>> matplotlib.get_configdir() >>>>>>>> '/home/az/.config/matplotlib' >>>>>>>> >>> print(matplotlib.__version__) >>>>>>>> 2.1.0 >>>>>>>> >>>>>>>> now if i get the simplest plot : >>>>>>>> >>>>>>>> [az at hp src]$ more ./main1.py >>>>>>>> import matplotlib.pyplot as plt >>>>>>>> print("imported") >>>>>>>> plt.plot([1,2,4,1]) >>>>>>>> print("plot is done") >>>>>>>> plt.show() >>>>>>>> print("show is done") >>>>>>>> >>>>>>>> [az at hp src]$ python3.5 main1.py --verbose-debug >>>>>>>> $HOME=/home/az >>>>>>>> matplotlib data path /home/az/.local/lib/python3.5/ >>>>>>>> site-packages/matplotlib/mpl-data >>>>>>>> loaded rc file /home/az/.local/lib/python3.5/ >>>>>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>>>>> matplotlib version 2.1.0 >>>>>>>> verbose.level debug >>>>>>>> interactive is False >>>>>>>> platform is linux >>>>>>>> loaded modules: ['_locale', 'urllib.request', >>>>>>>> 'numpy.lib.shape_base', 'numpy.matrixlib', 'ipaddress', 'hashlib', >>>>>>>> 'collections', 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', >>>>>>>> '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', >>>>>>>> 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', >>>>>>>> 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', >>>>>>>> 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', >>>>>>>> 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', >>>>>>>> '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', >>>>>>>> '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', >>>>>>>> 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', >>>>>>>> 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', >>>>>>>> 'json.scanner', 'os', 'http', 'functools', 'unittest.main', ' >>>>>>>> numpy.linalg.info', '_heapq', 'token', 'pathlib', 'tokenize', >>>>>>>> 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', >>>>>>>> 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', >>>>>>>> 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', >>>>>>>> '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', >>>>>>>> 'selectors', 'numpy.core', 'json.encoder', 'operator', >>>>>>>> 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', >>>>>>>> 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', >>>>>>>> 'importlib._bootstrap_external', 'mtrand', 'importlib._bootstrap', >>>>>>>> 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', >>>>>>>> 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', >>>>>>>> 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', >>>>>>>> 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', >>>>>>>> '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', >>>>>>>> 'numpy.lib', '_thread', 'time', '_frozen_importlib', ' >>>>>>>> numpy.core.info', 'numpy.core.multiarray', 'math', '_opcode', >>>>>>>> 'urllib.parse', 'distutils.sysconfig', 'ntpath', 'argparse', 'types', >>>>>>>> 'sre_compile', 'glob', '__main__', 'email._encoded_words', 'socket', >>>>>>>> '_struct', 'numpy.fft.info', 'unittest.signals', >>>>>>>> 'numpy.lib.npyio', 'grp', 'urllib.error', '_io', 'numpy._globals', >>>>>>>> 'gettext', 'numpy.compat.py3k', 'distutils', 'email.charset', 'ast', >>>>>>>> 'numpy.lib.function_base', 'uu', 'encodings', 'urllib', >>>>>>>> 'numpy.lib.twodim_base', 'encodings.latin_1', 'tempfile', >>>>>>>> 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', 'os.path', >>>>>>>> '_imp', 'email.base64mime', 'email.message', 'email.header', 'opcode', >>>>>>>> 'encodings.utf_8', 'reprlib', '_stat', '_warnings', 'email.feedparser', >>>>>>>> 'numpy.testing.utils', 'numpy.lib.utils', 'genericpath', >>>>>>>> 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', '_compression', >>>>>>>> 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', 'sysconfig', >>>>>>>> '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', '_random', >>>>>>>> 'email.iterators', '_collections_abc', '__future__', 'email', >>>>>>>> 'numpy._distributor_init', 'unittest.loader', '_bootlocale', >>>>>>>> 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', >>>>>>>> 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', >>>>>>>> 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', >>>>>>>> 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', >>>>>>>> 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', >>>>>>>> 'encodings.aliases', 'numpy.lib.index_tricks', 'numpy.random.info', >>>>>>>> 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern', >>>>>>>> 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', >>>>>>>> 'locale', 'email.errors', 'numpy.core.numerictypes', >>>>>>>> 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', >>>>>>>> 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', >>>>>>>> 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', >>>>>>>> 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', >>>>>>>> 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', >>>>>>>> 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', >>>>>>>> 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', >>>>>>>> '_pickle', '_ssl', 'matplotlib.compat.subprocess', 'numpy.random', >>>>>>>> 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', >>>>>>>> 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', >>>>>>>> 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', >>>>>>>> 'unittest.result', 're', 'http.client', 'numpy.lib.info', >>>>>>>> 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', >>>>>>>> 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', >>>>>>>> 'string', 'numpy.core.numeric', 'numpy.ma', 'numpy.fft', 'ctypes', >>>>>>>> 'numpy.random.mtrand', 'matplotlib.cbook.deprecation', >>>>>>>> '_datetime', 'builtins'] >>>>>>>> CACHEDIR=/home/az/.cache/matplotlib >>>>>>>> Using fontManager instance from /home/az/.cache/matplotlib/fon >>>>>>>> tList.json >>>>>>>> backend TkAgg version 8.6 >>>>>>>> imported >>>>>>>> ^C >>>>>>>> Hangs at this point with CPU @ 100% >>>>>>>> >>>>>>>> grep -v '#' /home/az/.local/lib/python3.5/ >>>>>>>> site-packages/matplotlib/mpl-data/matplotlibrc >>>>>>>> >>>>>>>> The only line is : >>>>>>>> backend : TkAgg >>>>>>>> >>>>>>>> >>>>>>>> [az at hp src]$ gcc --version >>>>>>>> gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >>>>>>>> >>>>>>>> I installed using pip3 into --user directory. >>>>>>>> but i also remember that i used dnf to get tkInnter installed: >>>>>>>> rpm -qa | grep tkin >>>>>>>> python3-tkinter-3.5.3-6.fc24.x86_64 >>>>>>>> tkinter-2.7.13-2.fc24.x86_64 >>>>>>>> tix-1:8.4.3-17.fc24.x86_64 >>>>>>>> if i were to compare "pip3 list" between system (root) and the user >>>>>>>> (az): >>>>>>>> diff -u /tmp/root_pip /tmp/usr_pip >>>>>>>> --- /tmp/root_pip 2017-11-04 15:26:09.612643559 -0400 >>>>>>>> +++ /tmp/usr_pip 2017-11-04 15:25:52.396473226 -0400 >>>>>>>> @@ -1,39 +1,65 @@ >>>>>>>> astroid (1.4.5) >>>>>>>> beautifulsoup4 (4.6.0) >>>>>>>> +bleach (2.1) >>>>>>>> blivet (1.20.3) >>>>>>>> chardet (2.2.1) >>>>>>>> coverage (4.4.1) >>>>>>>> cssselect (0.9.1) >>>>>>>> cupshelpers (1.0) >>>>>>>> +cx-Oracle (6.0.2) >>>>>>>> cycler (0.10.0) >>>>>>>> decorator (4.0.11) >>>>>>>> distro (1.0.2) >>>>>>>> dnf-langpacks (0.15.1) >>>>>>>> +entrypoints (0.2.3) >>>>>>>> fros (1.1) >>>>>>>> -html5lib (0.999) >>>>>>>> +html5lib (1.0b10) >>>>>>>> humanize (0.5.1) >>>>>>>> ib-insync (0.8.5) >>>>>>>> +ibapi (9.73.2) >>>>>>>> iniparse (0.4) >>>>>>>> initial-setup (0.3.40) >>>>>>>> IPy (0.81) >>>>>>>> +ipykernel (4.6.1) >>>>>>>> +ipython (6.2.0) >>>>>>>> +ipython-genutils (0.2.0) >>>>>>>> ipywidgets (7.0.0) >>>>>>>> isc (1.0) >>>>>>>> javapackages (4.6.0) >>>>>>>> +jedi (0.11.0) >>>>>>>> +Jinja2 (2.9.6) >>>>>>>> +jsonschema (2.6.0) >>>>>>>> jupyter (1.0.0) >>>>>>>> +jupyter-client (5.1.0) >>>>>>>> +jupyter-console (5.2.0) >>>>>>>> +jupyter-core (4.3.0) >>>>>>>> langtable (0.0.35) >>>>>>>> lazy-object-proxy (1.2.1) >>>>>>>> lxml (3.7.2) >>>>>>>> +MarkupSafe (1.0) >>>>>>>> +matplotlib (2.1.0) >>>>>>>> +mistune (0.7.4) >>>>>>>> +nbconvert (5.3.1) >>>>>>>> +nbformat (4.4.0) >>>>>>>> +notebook (5.1.0) >>>>>>>> ntplib (0.3.3) >>>>>>>> numpy (1.13.3) >>>>>>>> ordered-set (2.0.0) >>>>>>>> pandas (0.20.3) >>>>>>>> +pandocfilters (1.4.2) >>>>>>>> +parso (0.1.0) >>>>>>>> +pexpect (4.2.1) >>>>>>>> +pickleshare (0.7.4) >>>>>>>> pid (2.0.1) >>>>>>>> Pillow (3.2.0) >>>>>>>> pip (9.0.1) >>>>>>>> +prompt-toolkit (1.0.15) >>>>>>>> +ptyprocess (0.5.2) >>>>>>>> pwquality (1.3.0) >>>>>>>> pycups (1.9.72) >>>>>>>> pycurl (7.43.0) >>>>>>>> pyenchant (1.6.8) >>>>>>>> +Pygments (2.2.0) >>>>>>>> pygobject (3.20.1) >>>>>>>> pygpgme (0.3) >>>>>>>> pyinotify (0.9.6) >>>>>>>> @@ -42,6 +68,7 @@ >>>>>>>> pylint (1.5.6) >>>>>>>> pyparsing (2.2.0) >>>>>>>> pyparted (3.10.7) >>>>>>>> +PyQt5 (5.9) >>>>>>>> PySocks (1.5.6) >>>>>>>> python-augeas (0.5.0) >>>>>>>> python-dateutil (2.6.1) >>>>>>>> @@ -50,6 +77,9 @@ >>>>>>>> pytz (2017.2) >>>>>>>> pyudev (0.21.0) >>>>>>>> pyxdg (0.25) >>>>>>>> +pyzmq (16.0.2) >>>>>>>> +qtconsole (4.3.1) >>>>>>>> +Quamash (0.5.5) >>>>>>>> requests (2.10.0) >>>>>>>> requests-file (1.4) >>>>>>>> requests-ftp (0.3.1) >>>>>>>> @@ -60,11 +90,21 @@ >>>>>>>> sepolicy (1.1) >>>>>>>> setroubleshoot (1.1) >>>>>>>> setuptools (20.1.1) >>>>>>>> +simplegeneric (0.8.1) >>>>>>>> +sip (4.19.3) >>>>>>>> six (1.11.0) >>>>>>>> slip (0.6.4) >>>>>>>> slip.dbus (0.6.4) >>>>>>>> sos (3.2) >>>>>>>> SSSDConfig (1.15.3) >>>>>>>> systemd-python (232) >>>>>>>> +terminado (0.6) >>>>>>>> +testpath (0.3.1) >>>>>>>> +tornado (4.5.2) >>>>>>>> +traitlets (4.3.2) >>>>>>>> +tws-async (0.5.5) >>>>>>>> urllib3 (1.15.1) >>>>>>>> +wcwidth (0.1.7) >>>>>>>> +webencodings (0.5.1) >>>>>>>> +widgetsnbextension (3.0.3) >>>>>>>> wrapt (1.10.10) >>>>>>>> >>>>>>>> >>>>>>>> I just removed html5lib from system(root) , but tha made no >>>>>>>> difference to the plotting.. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z >>>>>>>> wrote: >>>>>>>> >>>>>>>>> hello, >>>>>>>>> the issue i'm experiencing is local to my laptop ( the other >>>>>>>>> machines i have run examples just fine). >>>>>>>>> I described it here https://www.mail-archive.com/p >>>>>>>>> ython-list at python.org/msg432343.html in details. >>>>>>>>> i searched around, but none of the proposed workarounds helped. >>>>>>>>> >>>>>>>>> Is there a way to enable some-kind of debugging or verbose output >>>>>>>>> to see what exactly is happening behind the scene? >>>>>>>>> >>>>>>>>> Thank you. >>>>>>>>> AZ >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Matplotlib-users mailing list >>>>>>>> Matplotlib-users at python.org >>>>>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >>> -- >>> Jody Klymak >>> http://web.uvic.ca/~jklymak/ >>> >>> >>> >>> >>> >>> >> >> -- >> Jody Klymak >> http://web.uvic.ca/~jklymak/ >> >> >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Mon Nov 13 02:09:41 2017 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 13 Nov 2017 18:09:41 +1100 Subject: [Matplotlib-users] ToolManager Message-ID: <349583cb-2bd6-454d-a1d6-9c45e6aeb6d7@Spark> Hi, I?m trying to add elements to the matplotlib toolbar *using the Qt5 backend*. I tried running this example code: https://matplotlib.org/examples/user_interfaces/toolmanager.html But unfortunately it fails when using Qt5 with the error ? ? fig.canvas.manager.toolmanager.add_tool('List', ListTools) AttributeError: 'FigureManagerQT' object has no attribute ?toolmanager' Is toolmanager only available for GTK? Is there an equivalent way of achieving what the script is doing in other backends? Thanks, Juan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Wed Nov 15 19:19:03 2017 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Thu, 16 Nov 2017 11:19:03 +1100 Subject: [Matplotlib-users] ToolManager In-Reply-To: <349583cb-2bd6-454d-a1d6-9c45e6aeb6d7@Spark> References: <349583cb-2bd6-454d-a1d6-9c45e6aeb6d7@Spark> Message-ID: If anyone can find time to respond to this, I promise a PR to the docs explaining the solution?! On 13 Nov 2017, 6:09 PM +1100, Juan Nunez-Iglesias , wrote: > Hi, > > I?m trying to add elements to the matplotlib toolbar *using the Qt5 backend*. I tried running this example code: > > https://matplotlib.org/examples/user_interfaces/toolmanager.html > > But unfortunately it fails when using Qt5 with the error > > ? ? fig.canvas.manager.toolmanager.add_tool('List', ListTools) > AttributeError: 'FigureManagerQT' object has no attribute ?toolmanager' > > Is toolmanager only available for GTK? Is there an equivalent way of achieving what the script is doing in other backends? > > Thanks, > > Juan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Mon Nov 20 13:37:11 2017 From: ndbecker2 at gmail.com (Neal Becker) Date: Mon, 20 Nov 2017 13:37:11 -0500 Subject: [Matplotlib-users] ValueError: Can only output finite numbers in PDF Message-ID: I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf gave the error ValueError: Can only output finite numbers in PDF Of course I can workaround it, but it's inconsistent (and annoying). From jklymak at uvic.ca Mon Nov 20 13:47:58 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Mon, 20 Nov 2017 10:47:58 -0800 Subject: [Matplotlib-users] ValueError: Can only output finite numbers in PDF In-Reply-To: References: Message-ID: <71144CF6-7D06-4A96-91D4-5A574591B423@uvic.ca> > On 20 Nov 2017, at 10:37 AM, Neal Becker wrote: > > I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf > gave the error > ValueError: Can only output finite numbers in PDF > > > Of course I can workaround it, but it's inconsistent (and annoying). That does sound annoying. If you give a MSCWE, and a more complete backtrace, maybe it can be fixed. Probably better to just make a github issue (after searching if it already exists). Cheers, Jody From yw5aj at virginia.edu Mon Nov 20 14:38:02 2017 From: yw5aj at virginia.edu (Yuxiang Wang) Date: Mon, 20 Nov 2017 11:38:02 -0800 Subject: [Matplotlib-users] ValueError: Can only output finite numbers in PDF In-Reply-To: <71144CF6-7D06-4A96-91D4-5A574591B423@uvic.ca> References: <71144CF6-7D06-4A96-91D4-5A574591B423@uvic.ca> Message-ID: Being curious, MSCWE stands for? Shawn On Mon, Nov 20, 2017 at 10:47 AM, Jody Klymak wrote: > > >> On 20 Nov 2017, at 10:37 AM, Neal Becker wrote: >> >> I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf >> gave the error >> ValueError: Can only output finite numbers in PDF >> >> >> Of course I can workaround it, but it's inconsistent (and annoying). > > That does sound annoying. > > If you give a MSCWE, and a more complete backtrace, maybe it can be fixed. Probably better to just make a github issue (after searching if it already exists). > > Cheers, Jody > > > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -- Yuxiang "Shawn" Wang, PhD yw5aj at virginia.edu +1 (434) 284-0836 From vincent.adrien at gmail.com Mon Nov 20 14:45:37 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Mon, 20 Nov 2017 11:45:37 -0800 Subject: [Matplotlib-users] ValueError: Can only output finite numbers in PDF In-Reply-To: References: <71144CF6-7D06-4A96-91D4-5A574591B423@uvic.ca> Message-ID: I guess ?Minimal Self-Contained Working Example? (as a variation of [SSCCE](http://www.sscce.org/), etc.) Best, Adrien On 11/20/2017 11:38 AM, Yuxiang Wang wrote: > Being curious, MSCWE stands for? > > Shawn > > On Mon, Nov 20, 2017 at 10:47 AM, Jody Klymak wrote: >> >> >>> On 20 Nov 2017, at 10:37 AM, Neal Becker wrote: >>> >>> I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf >>> gave the error >>> ValueError: Can only output finite numbers in PDF >>> >>> >>> Of course I can workaround it, but it's inconsistent (and annoying). >> >> That does sound annoying. >> >> If you give a MSCWE, and a more complete backtrace, maybe it can be fixed. Probably better to just make a github issue (after searching if it already exists). >> >> Cheers, Jody >> >> >> >> >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users > > > From yw5aj at virginia.edu Mon Nov 20 18:38:27 2017 From: yw5aj at virginia.edu (Yuxiang Wang) Date: Mon, 20 Nov 2017 15:38:27 -0800 Subject: [Matplotlib-users] ValueError: Can only output finite numbers in PDF In-Reply-To: References: <71144CF6-7D06-4A96-91D4-5A574591B423@uvic.ca> Message-ID: Ah got it. Thanks Adrien! Shawn On Mon, Nov 20, 2017 at 11:45 AM, vincent.adrien at gmail.com wrote: > I guess ?Minimal Self-Contained Working Example? (as a variation of > [SSCCE](http://www.sscce.org/), etc.) > > Best, > Adrien > > > On 11/20/2017 11:38 AM, Yuxiang Wang wrote: >> >> Being curious, MSCWE stands for? >> >> Shawn >> >> On Mon, Nov 20, 2017 at 10:47 AM, Jody Klymak wrote: >>> >>> >>> >>>> On 20 Nov 2017, at 10:37 AM, Neal Becker wrote: >>>> >>>> I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf >>>> gave the error >>>> ValueError: Can only output finite numbers in PDF >>>> >>>> >>>> Of course I can workaround it, but it's inconsistent (and annoying). >>> >>> >>> That does sound annoying. >>> >>> If you give a MSCWE, and a more complete backtrace, maybe it can be >>> fixed. Probably better to just make a github issue (after searching if it >>> already exists). >>> >>> Cheers, Jody >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> >> >> > -- Yuxiang "Shawn" Wang, PhD yw5aj at virginia.edu +1 (434) 284-0836 From solarjoe at posteo.org Tue Nov 21 08:20:44 2017 From: solarjoe at posteo.org (Joe) Date: Tue, 21 Nov 2017 14:20:44 +0100 Subject: [Matplotlib-users] Tabstops render as squares Message-ID: <1a12e92d8b44efd4925887e2c7bc0a27@posteo.de> Hello, I was trying to render a pdf document with some data aligned by tabstops. But Matplotlib renders the tabs as squares, at first I thought it is related to the pdf, but it also happens with titles or labels. I know it does not make much sense there, but this is as far as I could break it down. ----------- import matplotlib from pylab import * #matplotlib.rcParams['pdf.fonttype'] = 42 #42 #TTF 42, 3 ? matplotlib.rcParams['ps.useafm'] = True matplotlib.rcParams['pdf.use14corefonts'] = True #this seems to work, but only on my simple example #it throws a lot of latex errors with my original code. #matplotlib.rcParams['text.usetex'] = True figure(figsize=(3,3)) title('Page' + '\t' + 'One') show() ------------ And ideas how to solve this? Joe From s.molnar at sbcglobal.net Wed Nov 22 16:01:36 2017 From: s.molnar at sbcglobal.net (Stephen P. Molnar) Date: Wed, 22 Nov 2017 16:01:36 -0500 Subject: [Matplotlib-users] ERROR: _tkinter.TclError: can't invoke "wm" command: application has been destroyed Message-ID: <5A15E5B0.1000200@sbcglobal.net> I am running up to date Matplotlib in Python3.5 on my Debian Stretch Platform. I have not made any changes of which I am aware, but I have started getting errors when running a Python script that I have written to plot data obtained from a FORTRAN program. Enter Molecule ID: A Traceback (most recent call last): File "MolT_5IMT_w_3_2_plot.py", line 83, in fig.savefig(name_plt,bbox_inches='tight') File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 1814, in savefig self.canvas.print_figure(fname, **kwargs) File "/usr/local/lib/python3.5/dist-packages/matplotlib/backend_bases.py", line 2180, in print_figure self.figure.dpi = dpi File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 436, in _set_dpi self.set_size_inches(w, h, forward=forward) File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 745, in set_size_inches manager.resize(int(canvasw), int(canvash)) File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_tkagg.py", line 540, in resize self.canvas._tkcanvas.master.geometry("%dx%d" % (width, height)) File "/usr/lib/python3.5/tkinter/__init__.py", line 1698, in wm_geometry return self.tk.call('wm', 'geometry', self._w, newGeometry) _tkinter.TclError: can't invoke "wm" command: application has been destroyed ------------------ (program exited with code: 1) Press return to continue I have attached the Python script and an input file to this message. I would appreciate some assistance in solving this problem Thanks in advance. -- Stephen P. Molnar, Ph.D. Life is a fuzzy set www.molecular-modeling.net Stochastic and multivariate (614)312-7528 (c) Skype: smolnar1 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MultiplePlots_3.py Type: application/x-chimera Size: 1662 bytes Desc: not available URL: -------------- next part -------------- 0.150000 6327.754955 3100.115315 -0.273330 0.300000 4974.437669 2423.580149 -0.260019 0.450000 3413.782497 1649.373697 -0.226646 0.600000 2147.367854 1028.342687 -0.187167 0.750000 1326.194478 631.151522 -0.155853 0.900000 835.901348 396.527070 -0.130189 1.050000 521.917162 247.005495 -0.110868 1.200000 308.563248 146.262688 -0.108866 1.350000 172.485314 83.007579 -0.117236 1.500000 88.213222 44.070414 -0.109013 1.650000 25.187526 14.387829 -0.079685 1.800000 -30.012126 -12.017755 -0.058445 1.950000 -73.172867 -32.769861 -0.061001 2.100000 -100.304912 -46.043693 -0.065431 2.250000 -114.697667 -53.435231 -0.052830 2.400000 -118.104612 -55.560292 -0.038336 2.550000 -105.332340 -49.810498 -0.039741 2.700000 -72.819694 -34.544098 -0.043812 2.850000 -29.772303 -14.130725 -0.028663 3.000000 3.669097 1.958608 0.000127 3.150000 10.821068 5.743063 0.018845 3.300000 -9.406689 -3.527196 0.018620 3.450000 -44.287195 -19.931307 0.009597 3.600000 -79.307082 -36.490689 0.000075 3.750000 -107.430024 -49.799698 -0.010608 3.900000 -128.600825 -59.914690 -0.020417 4.050000 -144.310370 -67.596568 -0.020784 4.200000 -154.473618 -72.746020 -0.007487 4.350000 -156.801724 -74.327306 0.014513 4.500000 -145.529868 -69.862430 0.040273 4.650000 -111.628677 -55.172712 0.069287 4.800000 -49.329108 -27.083311 0.095657 4.950000 33.974228 11.675601 0.104490 5.100000 115.624909 50.767958 0.088677 5.250000 169.634729 77.469455 0.062759 5.400000 184.134126 85.309308 0.048441 5.550000 168.365558 78.213371 0.049341 5.700000 142.462227 66.035119 0.050230 5.850000 120.122121 55.845745 0.038752 6.000000 100.959347 47.584818 0.017725 6.150000 78.068211 37.601525 -0.003554 6.300000 49.546989 24.680503 -0.020955 6.450000 20.338783 11.214185 -0.036078 6.600000 -4.973480 -0.490625 -0.050551 6.750000 -26.657600 -10.599693 -0.063097 6.900000 -46.296335 -19.922785 -0.071311 7.050000 -62.299471 -27.613691 -0.074071 7.200000 -71.240399 -31.945776 -0.070439 7.350000 -71.808940 -32.341336 -0.058019 7.500000 -65.448941 -29.553877 -0.037231 7.650000 -54.643174 -24.704324 -0.016727 7.800000 -42.913074 -19.363088 -0.007710 7.950000 -35.328067 -15.930235 -0.011434 8.100000 -35.458669 -16.164385 -0.018448 8.250000 -40.401904 -18.741903 -0.020262 8.400000 -40.745042 -19.244242 -0.014666 8.550000 -27.974353 -13.662551 -0.001372 8.700000 -2.863683 -2.276877 0.017217 8.850000 23.696028 9.976958 0.031326 9.000000 38.626008 17.096202 0.030962 9.150000 36.204816 16.344192 0.018633 9.300000 21.199622 9.765159 0.005714 9.450000 4.069540 2.110755 -0.003015 9.600000 -6.374190 -2.538721 -0.011267 9.750000 -6.625953 -2.586622 -0.018944 9.900000 2.661412 1.576005 -0.018723 10.050000 18.894748 8.728285 -0.005723 10.200000 37.863606 17.046237 0.017523 10.350000 53.624148 23.922523 0.045255 10.500000 60.650742 26.835886 0.070305 10.650000 57.132205 24.958896 0.083126 10.800000 45.572121 19.552385 0.077380 10.950000 29.988599 12.568715 0.057617 11.100000 13.370460 5.302119 0.035906 11.250000 -2.114252 -1.449096 0.019921 11.400000 -14.200821 -6.726981 0.008092 11.550000 -21.547910 -9.835122 -0.003799 11.700000 -25.523446 -11.349474 -0.015778 11.850000 -29.752867 -13.033826 -0.025015 12.000000 -37.166437 -16.367986 -0.030877 12.150000 -47.338426 -21.149641 -0.035894 12.300000 -56.638240 -25.558702 -0.042134 12.450000 -61.097138 -27.633344 -0.048430 12.600000 -59.396782 -26.770483 -0.051793 12.750000 -52.910680 -23.698755 -0.050786 12.900000 -42.543465 -18.884260 -0.046567 13.050000 -26.282824 -11.367918 -0.040237 13.200000 -1.514840 0.060188 -0.029895 13.350000 29.524730 14.284532 -0.012628 13.500000 57.749622 27.043745 0.009173 13.650000 72.376011 33.427053 0.026128 13.800000 68.915978 31.514267 0.030275 13.950000 52.218641 23.634943 0.023697 14.100000 31.913359 14.222284 0.014524 14.250000 15.178397 6.546906 0.006518 14.400000 3.537427 1.281334 -0.001095 14.550000 -4.597508 -2.343386 -0.005548 14.700000 -9.672662 -4.554489 -0.001795 14.850000 -9.847040 -4.456990 0.007086 15.000000 -3.606245 -1.290817 0.010269 15.150000 7.366895 4.095904 0.003510 15.300000 18.359367 9.300748 -0.004420 15.450000 24.450980 11.878501 -0.003318 15.600000 23.166159 10.764650 0.006777 15.750000 15.279702 6.571164 0.018890 15.900000 4.176673 1.054503 0.028072 16.050000 -5.754333 -3.712654 0.032853 16.200000 -11.647544 -6.418179 0.032227 16.350000 -14.191268 -7.406286 0.025950 16.500000 -16.833102 -8.360068 0.016350 16.650000 -22.483656 -10.757035 0.006952 16.800000 -31.247001 -14.716277 -0.000342 16.950000 -41.143177 -19.304410 -0.005554 17.100000 -49.597601 -23.281461 -0.008894 17.250000 -53.576330 -25.177034 -0.010143 17.400000 -50.075276 -23.508521 -0.009875 17.550000 -38.593348 -18.003749 -0.010012 17.700000 -22.601617 -10.353745 -0.011983 17.850000 -6.576618 -2.746393 -0.014897 18.000000 8.479315 4.353553 -0.016710 18.150000 24.733835 12.025132 -0.016562 18.300000 42.327047 20.321677 -0.014630 18.450000 56.451775 26.906925 -0.011014 18.600000 61.233163 29.018249 -0.006781 18.750000 55.807780 26.365211 -0.004465 18.900000 45.107989 21.364930 -0.004918 19.050000 34.689147 16.589420 -0.005364 19.200000 25.921443 12.551389 -0.003479 19.350000 16.493394 8.077024 -0.001408 19.500000 4.488899 2.283582 -0.002338 19.650000 -8.969264 -4.229907 -0.004932 19.800000 -20.569049 -9.849067 -0.004959 19.950000 -27.112471 -13.030244 -0.001249 20.100000 -26.916336 -12.937298 0.003361 20.250000 -20.251808 -9.675987 0.006179 20.400000 -9.604365 -4.467667 0.006926 20.550000 0.720591 0.555271 0.006462 20.700000 6.505781 3.337091 0.005622 20.850000 6.114467 3.119483 0.005208 21.000000 1.222629 0.738566 0.005662 21.150000 -5.131565 -2.350422 0.006599 21.300000 -11.235737 -5.327516 0.007040 21.450000 -17.339878 -8.279982 0.005966 21.600000 -23.729630 -11.324398 0.002997 21.750000 -28.626672 -13.659816 -0.000632 21.900000 -28.680338 -13.764779 -0.002120 22.050000 -22.117762 -10.800936 0.000525 22.200000 -11.450973 -5.880999 0.005831 22.350000 -2.434399 -1.660014 0.009599 22.500000 0.459473 -0.259807 0.008981 22.650000 -2.129396 -1.429481 0.005352 22.800000 -5.115985 -2.807290 0.002484 22.950000 -3.292882 -1.948856 0.002330 23.100000 5.007607 1.950969 0.003651 23.250000 17.579391 7.912061 0.004531 23.400000 30.207087 14.000963 0.004652 23.550000 38.722806 18.219516 0.004611 23.700000 40.794191 19.373156 0.004346 23.850000 37.058491 17.735916 0.002986 24.000000 30.240818 14.665050 -0.000394 24.150000 22.436655 11.182298 -0.005885 24.300000 13.574654 7.167770 -0.011996 24.450000 3.065692 2.256847 -0.016580 24.600000 -7.791281 -2.904608 -0.019300 24.750000 -16.244875 -6.947933 -0.021406 24.900000 -20.749536 -9.174221 -0.021927 25.050000 -22.057617 -10.023033 -0.017125 25.200000 -21.568013 -10.133384 -0.006334 25.350000 -19.750130 -9.577402 0.004712 25.500000 -16.754119 -8.288748 0.009774 25.650000 -13.604369 -6.731196 0.008721 25.800000 -11.656015 -5.614245 0.005151 25.950000 -11.001480 -5.073846 0.000739 26.100000 -10.282566 -4.561067 -0.004057 26.250000 -8.296693 -3.588559 -0.006673 26.400000 -5.189922 -2.251948 -0.004632 26.550000 -1.727895 -0.854245 0.000352 26.700000 2.028706 0.685819 0.004098 26.850000 6.489376 2.645891 0.004808 27.000000 10.954297 4.708210 0.003759 27.150000 13.138766 5.756019 0.002601 27.300000 11.093002 4.833243 0.002143 27.450000 5.563610 2.289215 0.002675 27.600000 -0.161042 -0.312714 0.003925 27.750000 -3.003983 -1.540918 0.005501 27.900000 -2.346809 -1.172957 0.007876 28.050000 0.544982 0.131601 0.011559 28.200000 4.494502 1.843007 0.015208 28.350000 8.922375 3.795633 0.016481 28.500000 12.811781 5.592202 0.015134 28.650000 14.574869 6.468851 0.013364 28.800000 13.538042 6.054919 0.012412 28.950000 10.735519 4.836526 0.010669 29.100000 7.537223 3.491677 0.006242 29.250000 4.081950 2.073071 -0.000039 29.400000 -0.172450 0.266344 -0.005676 29.550000 -4.851138 -1.785885 -0.009750 29.700000 -8.677985 -3.469866 -0.013504 29.850000 -11.104449 -4.520310 -0.017883 30.000000 -13.041988 -5.396163 -0.021951 30.150000 -15.620583 -6.661243 -0.023897 From wrw at mac.com Wed Nov 22 16:40:54 2017 From: wrw at mac.com (William Ray Wing) Date: Wed, 22 Nov 2017 16:40:54 -0500 Subject: [Matplotlib-users] ERROR: _tkinter.TclError: can't invoke "wm" command: application has been destroyed In-Reply-To: <5A15E5B0.1000200@sbcglobal.net> References: <5A15E5B0.1000200@sbcglobal.net> Message-ID: <03E370AB-5145-479D-B971-38A71B81AFEF@mac.com> Sent from my iPhone > On Nov 22, 2017, at 4:01 PM, Stephen P. Molnar wrote: > > I am running up to date Matplotlib in Python3.5 on my Debian Stretch Platform. > > I have not made any changes of which I am aware, but I have started getting errors when running a Python script that I have written to plot data obtained from a FORTRAN program. > This like a first cousin to the problem you recently posted on the Tutor list. Do you get the same result if you invoke the script directly from the command line, i.e. $python MolT_5IMT_w_3_2_plot.py And not in iPython or Whatever? Bill > Enter Molecule ID: A > Traceback (most recent call last): > File "MolT_5IMT_w_3_2_plot.py", line 83, in > fig.savefig(name_plt,bbox_inches='tight') > File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 1814, in savefig > self.canvas.print_figure(fname, **kwargs) > File "/usr/local/lib/python3.5/dist-packages/matplotlib/backend_bases.py", line 2180, in print_figure > self.figure.dpi = dpi > File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 436, in _set_dpi > self.set_size_inches(w, h, forward=forward) > File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 745, in set_size_inches > manager.resize(int(canvasw), int(canvash)) > File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_tkagg.py", line 540, in resize > self.canvas._tkcanvas.master.geometry("%dx%d" % (width, height)) > File "/usr/lib/python3.5/tkinter/__init__.py", line 1698, in wm_geometry > return self.tk.call('wm', 'geometry', self._w, newGeometry) > _tkinter.TclError: can't invoke "wm" command: application has been destroyed > > > ------------------ > (program exited with code: 1) > Press return to continue > > I have attached the Python script and an input file to this message. > > I would appreciate some assistance in solving this problem > > Thanks in advance. > -- > Stephen P. Molnar, Ph.D. Life is a fuzzy set > www.molecular-modeling.net Stochastic and multivariate > (614)312-7528 (c) > Skype: smolnar1 > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathoscope at netcourrier.com Thu Nov 23 04:30:11 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Thu, 23 Nov 2017 10:30:11 +0100 Subject: [Matplotlib-users] fonts Message-ID: hi i am new on this forum and i dont know if my first message is passed i encouter difficulties with this type of code : eq1=(r"$\rm{\sqrt{x}}Helvetica14$") plt.text(0.25, 0.5, eq1, ha='center', va='center', color="#11557c", alpha=1, transform=plt.gca().transAxes, fontsize=14, clip_on=True, family="serif", fontname="Helvetica") eq2=(r"$\rm{\sqrt{x}}Courier12$") plt.text(0.25, 0.6, eq2, ha='center', va='center', color="#11557c", alpha=1, transform=plt.gca().transAxes, fontsize=12, clip_on=True, fontname="Courier",rotation="15") because the text does not appear with the expected font i guess i miss something (something like a path for the fonts ?) but dont know what thanks for your help ?????????????????????????? Vincent Douce http://mathoscope.xyz 06=?13=?11=?07=?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.molnar at sbcglobal.net Thu Nov 23 07:35:10 2017 From: s.molnar at sbcglobal.net (Stephen P. Molnar) Date: Thu, 23 Nov 2017 07:35:10 -0500 Subject: [Matplotlib-users] ERROR: _tkinter.TclError: can't invoke "wm" command: application has been destroyed In-Reply-To: <03E370AB-5145-479D-B971-38A71B81AFEF@mac.com> References: <5A15E5B0.1000200@sbcglobal.net> <03E370AB-5145-479D-B971-38A71B81AFEF@mac.com> Message-ID: <5A16C07E.2030505@sbcglobal.net> On 11/22/2017 04:40 PM, William Ray Wing wrote: > > > Sent from my iPhone > > On Nov 22, 2017, at 4:01 PM, Stephen P. Molnar > wrote: > >> I am running up to date Matplotlib in Python3.5 on my Debian Stretch >> Platform. >> >> I have not made any changes of which I am aware, but I have started >> getting errors when running a Python script that I have written to >> plot data obtained from a FORTRAN program. >> > > This like a first cousin to the problem you recently posted on the > Tutor list. Do you get the same result if you invoke the script > directly from the command line, i.e. > > $python MolT_5IMT_w_3_2_plot.py > > And not in iPython or Whatever? > > Bill >> Enter Molecule ID: A >> Traceback (most recent call last): >> File "MolT_5IMT_w_3_2_plot.py", line 83, in >> fig.savefig(name_plt,bbox_inches='tight') >> File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", >> line 1814, in savefig >> self.canvas.print_figure(fname, **kwargs) >> File >> "/usr/local/lib/python3.5/dist-packages/matplotlib/backend_bases.py", >> line 2180, in print_figure >> self.figure.dpi = dpi >> File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", >> line 436, in _set_dpi >> self.set_size_inches(w, h, forward=forward) >> File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", >> line 745, in set_size_inches >> manager.resize(int(canvasw), int(canvash)) >> File >> "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_tkagg.py", >> line 540, in resize >> self.canvas._tkcanvas.master.geometry("%dx%d" % (width, height)) >> File "/usr/lib/python3.5/tkinter/__init__.py", line 1698, in >> wm_geometry >> return self.tk.call('wm', 'geometry', self._w, newGeometry) >> _tkinter.TclError: can't invoke "wm" command: application has been >> destroyed >> >> >> ------------------ >> (program exited with code: 1) >> Press return to continue >> >> I have attached the Python script and an input file to this message. >> >> I would appreciate some assistance in solving this problem >> >> Thanks in advance. >> -- >> Stephen P. Molnar, Ph.D. Life is a fuzzy set >> www.molecular-modeling.net Stochastic and multivariate >> (614)312-7528 (c) >> Skype: smolnar1 >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users I get exactly the same messages as soon as I close the plot. -- Stephen P. Molnar, Ph.D. Life is a fuzzy set www.molecular-modeling.net Stochastic and multivariate (614)312-7528 (c) Skype: smolnar1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From df388 at cam.ac.uk Thu Nov 23 21:42:14 2017 From: df388 at cam.ac.uk (dimitrif) Date: Thu, 23 Nov 2017 19:42:14 -0700 (MST) Subject: [Matplotlib-users] log xaxis for contourf Message-ID: <1511491334294-0.post@n5.nabble.com> Hi to all, I spent about 3 hours trying to fix a plotting problem I have with matplotlib.pyplot...unfortunately without any sucess. I want to have a logarithmic xaxis in my contourf plot. Since this is not directly possible, I took the log10 of the axis and simply used them. Doing so, I get some white space inside the plot for some reason. Can someone give me a hint why this is happening? I use the following fraction of code: #without log scale plt.figure(11), plt.cla() cf1 = plt.contourf(f_psd_welch, traverseCoord, 10*np.log10(psd_hotwire_FS_welch),cmap='viridis') cbar1 = plt.colorbar(cf1) plt.xlim([min(f_psd_welch), max(f_psd_welch)]), plt.ylim([-50, 50]) #with logscale plt.figure(11), plt.cla() cf1 = plt.contourf(np.log10(f_psd_welch), traverseCoord, 10*np.log10(psd_hotwire_FS_welch),cmap='viridis') cbar1 = plt.colorbar(cf1) plt.xlim([min(np.log10(f_psd_welch[1:])), max(np.log10(f_psd_welch[1:]))]), plt.ylim([-50, 50]) The output is attached. I would be happy about any help! Thanks, Dimitri -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From jklymak at uvic.ca Thu Nov 23 21:54:53 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Thu, 23 Nov 2017 18:54:53 -0800 Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: <1511491334294-0.post@n5.nabble.com> References: <1511491334294-0.post@n5.nabble.com> Message-ID: You are giving contour very irregularly spaced data in x. Its trying to come up w/ those last few contours with very little data and I guess its misbehaving. If it were me, I?d interpolate onto a regular log10 grid first and then send to contour. Then you have control over how the interpolation takes place... You may also want to consider just using pcolormesh. Cheers, Jody > On Nov 23, 2017, at 18:42 PM, dimitrif wrote: > > Hi to all, > > I spent about 3 hours trying to fix a plotting problem I have with > matplotlib.pyplot...unfortunately without any sucess. > > I want to have a logarithmic xaxis in my contourf plot. Since this is not > directly possible, I took the log10 of the axis and simply used them. Doing > so, I get some white space inside the plot for some reason. Can someone give > me a hint why this is happening? I use the following fraction of code: > > #without log scale > plt.figure(11), plt.cla() > cf1 = plt.contourf(f_psd_welch, traverseCoord, > 10*np.log10(psd_hotwire_FS_welch),cmap='viridis') > cbar1 = plt.colorbar(cf1) > plt.xlim([min(f_psd_welch), max(f_psd_welch)]), plt.ylim([-50, 50]) > > > > #with logscale > plt.figure(11), plt.cla() > cf1 = plt.contourf(np.log10(f_psd_welch), traverseCoord, > 10*np.log10(psd_hotwire_FS_welch),cmap='viridis') > cbar1 = plt.colorbar(cf1) > plt.xlim([min(np.log10(f_psd_welch[1:])), max(np.log10(f_psd_welch[1:]))]), > plt.ylim([-50, 50]) > > > > The output is attached. > I would be happy about any help! > > Thanks, > Dimitri > > > > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From ianthomas23 at gmail.com Fri Nov 24 02:36:36 2017 From: ianthomas23 at gmail.com (Ian Thomas) Date: Fri, 24 Nov 2017 07:36:36 +0000 Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: <1511491334294-0.post@n5.nabble.com> References: <1511491334294-0.post@n5.nabble.com> Message-ID: Dimitri, If you send me your data (f_psd_welch, traverseCoord and psd_hotwire_FS_welch) I will take a look at the problem. Ian On 24 November 2017 at 02:42, dimitrif wrote: > Hi to all, > > I spent about 3 hours trying to fix a plotting problem I have with > matplotlib.pyplot...unfortunately without any sucess. > > I want to have a logarithmic xaxis in my contourf plot. Since this is not > directly possible, I took the log10 of the axis and simply used them. Doing > so, I get some white space inside the plot for some reason. Can someone > give > me a hint why this is happening? I use the following fraction of code: > > #without log scale > plt.figure(11), plt.cla() > cf1 = plt.contourf(f_psd_welch, traverseCoord, > 10*np.log10(psd_hotwire_FS_welch),cmap='viridis') > cbar1 = plt.colorbar(cf1) > plt.xlim([min(f_psd_welch), max(f_psd_welch)]), plt.ylim([-50, 50]) > > > > #with logscale > plt.figure(11), plt.cla() > cf1 = plt.contourf(np.log10(f_psd_welch), traverseCoord, > 10*np.log10(psd_hotwire_FS_welch),cmap='viridis') > cbar1 = plt.colorbar(cf1) > plt.xlim([min(np.log10(f_psd_welch[1:])), max(np.log10(f_psd_welch[1:])) > ]), > plt.ylim([-50, 50]) > > > > The output is attached. > I would be happy about any help! > > Thanks, > Dimitri > > > > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users- > f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From df388 at cam.ac.uk Fri Nov 24 07:52:01 2017 From: df388 at cam.ac.uk (dimitrif) Date: Fri, 24 Nov 2017 05:52:01 -0700 (MST) Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: References: <1511491334294-0.post@n5.nabble.com> Message-ID: <1511527921123-0.post@n5.nabble.com> Hi Jody, I have tried pcolormesh but it 'smears' the data too much due to interpolation. Maybe there is no other way than interpolating manually to have full control. I just wonder, it seems like it works in Matlab without any issues but matpotlib struggles with log axis for contourf. Dimitri -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From df388 at cam.ac.uk Fri Nov 24 07:53:31 2017 From: df388 at cam.ac.uk (dimitrif) Date: Fri, 24 Nov 2017 05:53:31 -0700 (MST) Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: References: <1511491334294-0.post@n5.nabble.com> Message-ID: <1511528011805-0.post@n5.nabble.com> Hi Ian, I sent you an email. Dimitir -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From ianthomas23 at gmail.com Fri Nov 24 14:46:59 2017 From: ianthomas23 at gmail.com (Ian Thomas) Date: Fri, 24 Nov 2017 19:46:59 +0000 Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: <1511528011805-0.post@n5.nabble.com> References: <1511491334294-0.post@n5.nabble.com> <1511528011805-0.post@n5.nabble.com> Message-ID: Hi Dimitri, The problem is that your x data (f_psd_welch) begins at zero. Log10 of zero is minus infinity. Some of the contour x-values will be exactly zero and hence log10 of them is -inf; most will be larger than zero and hence log10 of them will be finite. Drawing polygons between finite and infinite values is bound to look messy. There is usually a numpy warning when you try np.log10(0.0), but it depends on some python settings so you may not have seen it. You had nearly solved the problem yourself as when you are calculating the minimum x-value to limit the contour plot axis you use np.min(np.log10(f_psd_welch[1:])) which excludes the first value which is log10(0.0) = -inf. There are 2 possible solutions: 1) Exclude the x=0 values from the plot, i.e. use cf1 = plt.contourf(np.log10(f_psd_welch[1:]), traverseCoord, 10*np.log10(psd_hotwire_FS_welch[:,1:]),cmap='viridis') 2) Add a very small amount to all x-values, i.e. cf1 = plt.contourf(np.log10(f_psd_welch + 1e-10), traverseCoord, 10*np.log10(psd_hotwire_FS_welch),cmap='viridis') We could add an explicit check to ensure that all arrays that are passed to contour contain only finite values, but then we would have to have a policy of doing that across all matplotlib functions which would be a major impact to the library and (arguably) unnecessarily affect the performance of 99.9% of mpl calls that don't need the check. The existing numpy log10 warning should suffice. Ian On 24 November 2017 at 12:53, dimitrif wrote: > Hi Ian, > > I sent you an email. > > Dimitir > > > > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users- > f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From df388 at cam.ac.uk Fri Nov 24 15:03:33 2017 From: df388 at cam.ac.uk (dimitrif) Date: Fri, 24 Nov 2017 13:03:33 -0700 (MST) Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: References: <1511491334294-0.post@n5.nabble.com> <1511528011805-0.post@n5.nabble.com> Message-ID: <1511553813848-0.post@n5.nabble.com> Hi Ian, Amazing, thank you very much for your help! Now, it works as expected. I actually got the following warning 'RuntimeWarning: divide by zero encountered in log10' when running the script but I couldn't connect it to the outcome. Sometimes a new pair of eyes and a fresh mind helps to solve the issue in a few seconds. Sounds logically for me that changing the library would not be necessary. I wonder why contourf does not have the option to switch the axes to log similar to loglog or semilogx? That would look much nicer and save a lot of time adjusting the axes of contourf. Dimitri -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From ianthomas23 at gmail.com Fri Nov 24 15:27:55 2017 From: ianthomas23 at gmail.com (Ian Thomas) Date: Fri, 24 Nov 2017 20:27:55 +0000 Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: <1511553813848-0.post@n5.nabble.com> References: <1511491334294-0.post@n5.nabble.com> <1511528011805-0.post@n5.nabble.com> <1511553813848-0.post@n5.nabble.com> Message-ID: Dimitri, Although there is no explicit 'log axis' argument that contour accepts, you can use this: plt.contourf(f_psd_welch, traverseCoord, 10*np.log10(psd_hotwire_FS_welch)) plt.gca().set_xscale('log') plt.xlim([np.min(f_psd_welch[1:]), np.max(f_psd_welch[1:])]) Ian On 24 November 2017 at 20:03, dimitrif wrote: > Hi Ian, > > Amazing, thank you very much for your help! Now, it works as expected. > > I actually got the following warning 'RuntimeWarning: divide by zero > encountered in log10' when running the script but I couldn't connect it to > the outcome. Sometimes a new pair of eyes and a fresh mind helps to solve > the issue in a few seconds. > > Sounds logically for me that changing the library would not be necessary. I > wonder why contourf does not have the option to switch the axes to log > similar to loglog or semilogx? That would look much nicer and save a lot of > time adjusting the axes of contourf. > > Dimitri > > > > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users- > f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From df388 at cam.ac.uk Sat Nov 25 08:06:17 2017 From: df388 at cam.ac.uk (dimitrif) Date: Sat, 25 Nov 2017 06:06:17 -0700 (MST) Subject: [Matplotlib-users] log xaxis for contourf In-Reply-To: References: <1511491334294-0.post@n5.nabble.com> <1511528011805-0.post@n5.nabble.com> <1511553813848-0.post@n5.nabble.com> Message-ID: <1511615177866-0.post@n5.nabble.com> Hi Ian, I didn't know how to do that. That is actuaclly exactly what I want. Thank you very much once again. Dimitri -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From jks at iki.fi Sun Nov 26 06:58:03 2017 From: jks at iki.fi (=?iso-8859-1?Q?Jouni_K=2E_Sepp=E4nen?=) Date: Sun, 26 Nov 2017 13:58:03 +0200 Subject: [Matplotlib-users] Tabstops render as squares References: <1a12e92d8b44efd4925887e2c7bc0a27@posteo.de> Message-ID: Joe writes: > I was trying to render a pdf document with some data > aligned by tabstops. I don't think there is any support for that kind of text layout. The closest feature is probably pyplot.table: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.table.html http://matplotlib.org/examples/pylab_examples/table_demo.html Another possibility is to use a monospaced font and align with spaces (possibly using str.expandtabs to generate the spaces): https://stackoverflow.com/a/30111217/26575 -- Jouni K. Sepp?nen http://www.iki.fi/jks From jks at iki.fi Sun Nov 26 07:04:45 2017 From: jks at iki.fi (=?iso-8859-1?Q?Jouni_K=2E_Sepp=E4nen?=) Date: Sun, 26 Nov 2017 14:04:45 +0200 Subject: [Matplotlib-users] ValueError: Can only output finite numbers in PDF References: Message-ID: Neal Becker writes: > I can plot my semilogy plot fine to Qt5Agg backend, but switching to pdf > gave the error > ValueError: Can only output finite numbers in PDF This means the pdf backend has received infinite values, probably from taking the logarithm of a nonpositive number. Somewhere in the chain between semilogy and the pdf backend there should be logic that decides what to do with those (e.g. clip to figure edge, or omit the point and adjacent lines entirely). In my copy of matplotlib 2.0.2 I don't see an error message from the following code. Instead the negative value and adjacent lines are simply missing. from matplotlib import pyplot as plt plt.semilogy([3,1,4,-1,5,9]) plt.savefig('semilogy.pdf') -- Jouni K. Sepp?nen http://www.iki.fi/jks From mathoscope at netcourrier.com Mon Nov 27 06:39:01 2017 From: mathoscope at netcourrier.com (vincent_mathoscope) Date: Mon, 27 Nov 2017 04:39:01 -0700 (MST) Subject: [Matplotlib-users] how to choose the font for the equations in a plt.text ? In-Reply-To: References: Message-ID: <1511782741187-0.post@n5.nabble.com> i have found iwrite it here in case it may be useful to someone then choose a style with ----- ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From Nicolas.Rougier at inria.fr Tue Nov 28 12:08:59 2017 From: Nicolas.Rougier at inria.fr (Nicolas Rougier) Date: Tue, 28 Nov 2017 18:08:59 +0100 Subject: [Matplotlib-users] Animation using 4D simplex noise Message-ID: <7508D5BF-EA0D-49C6-B352-B0DE3C97BE41@inria.fr> Hello, I?ve made a remake (using matplotlib of course) of a beautiful animation by https://necessarydisorder.wordpress.com/ (using simplex 4D noise). Just wanted to share the code and the resulting animation: https://github.com/rougier/alien-life Nicolas From padiarushi3012 at gmail.com Tue Nov 28 13:12:59 2017 From: padiarushi3012 at gmail.com (Rushikesh Padia) Date: Tue, 28 Nov 2017 23:42:59 +0530 Subject: [Matplotlib-users] Need guidance Message-ID: Hello guys, I am new to open source, I know python basics and would like contribute to this project. I want to know how to start, If anyone is working on new-user friendly tag or is beginner who started contributing please reply and who is experienced please guide. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Tue Nov 28 13:42:45 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Tue, 28 Nov 2017 10:42:45 -0800 Subject: [Matplotlib-users] Need guidance In-Reply-To: References: Message-ID: Rushikesh, Thanks for your intester in contributing to matplotlib. I recommend you read through the developer's docs to get up to speed with the basic git workflows and coding/documentation styles: http://matplotlib.org/devel/index.html Our issues on github have a lot tags, and it can be a lot to wade through. I recommend starting with "Difficulty:Easy" https://github.com/matplotlib/matplotlib/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Easy%22 "good first issue": https://github.com/matplotlib/matplotlib/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 and "new contributor friendly" https://github.com/matplotlib/matplotlib/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue++label%3Anew-contributor-friendly Hope to hear from you soon! -paul On Tue, Nov 28, 2017 at 10:12 AM, Rushikesh Padia wrote: > Hello guys, > I am new to open source, I know python basics and would like contribute to > this project. I want to know how to start, If anyone is working on new-user > friendly tag or is beginner who started contributing please reply and who > is experienced please guide. > Thank you. > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.adrien at gmail.com Tue Nov 28 19:23:00 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Tue, 28 Nov 2017 16:23:00 -0800 Subject: [Matplotlib-users] Animation using 4D simplex noise In-Reply-To: <7508D5BF-EA0D-49C6-B352-B0DE3C97BE41@inria.fr> References: <7508D5BF-EA0D-49C6-B352-B0DE3C97BE41@inria.fr> Message-ID: <4357da3f-5504-e64c-e928-f7844fa0bebc@gmail.com> Nicolas, As usual, very pleasant to the eye and neat stuff. Thank you for sharing it :). Best, Adrien On 11/28/2017 09:08 AM, Nicolas Rougier wrote: > > Hello, > > I?ve made a remake (using matplotlib of course) of a beautiful animation by https://necessarydisorder.wordpress.com/ (using simplex 4D noise). Just wanted to share the code and the resulting animation: > > > https://github.com/rougier/alien-life > > > Nicolas > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From nathan12343 at gmail.com Tue Nov 28 19:52:27 2017 From: nathan12343 at gmail.com (Nathan Goldbaum) Date: Wed, 29 Nov 2017 00:52:27 +0000 Subject: [Matplotlib-users] Animation using 4D simplex noise In-Reply-To: <7508D5BF-EA0D-49C6-B352-B0DE3C97BE41@inria.fr> References: <7508D5BF-EA0D-49C6-B352-B0DE3C97BE41@inria.fr> Message-ID: This makes me wish I could ?like? an e-mail. On Tue, Nov 28, 2017 at 12:09 PM Nicolas Rougier wrote: > > Hello, > > I?ve made a remake (using matplotlib of course) of a beautiful animation > by https://necessarydisorder.wordpress.com/ (using simplex 4D noise). > Just wanted to share the code and the resulting animation: > > > https://github.com/rougier/alien-life > > > Nicolas > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From padiarushi3012 at gmail.com Wed Nov 29 16:20:25 2017 From: padiarushi3012 at gmail.com (Rushikesh Padia) Date: Thu, 30 Nov 2017 02:50:25 +0530 Subject: [Matplotlib-users] Need help from less experienced or new contributor Message-ID: Is there any less experienced or new contributor who just started contributing to this project ? Please respond. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eulergaussriemann at gmail.com Wed Nov 29 17:11:19 2017 From: eulergaussriemann at gmail.com (David Goldsmith) Date: Wed, 29 Nov 2017 14:11:19 -0800 Subject: [Matplotlib-users] Need help from less experienced or new contributor In-Reply-To: References: Message-ID: Also, just to clarify/be sure of your meaning: new to matplotlib, or new to wanting to contribute to it? (If the former, you should probably gain some (quite a bit?) experience using the package before you consider contributing to it.) On Wed, Nov 29, 2017 at 2:08 PM, David Goldsmith < eulergaussriemann at gmail.com> wrote: > No, not inappropriate per se, but given your motivation, you may want to > post (and subscribe) to matplotlib-devel instead/also. Also, if you "dig > around" at the main site--matplotlib.org--I think you'll be able to find a > history of the package (if not, pretty sure Wikipedia has one), and > definitely contributor guidance (e.g., https://matplotlib.org/ > devel/gitwash/development_workflow.html?highlight=history and > https://matplotlib.org/devel/gitwash/maintainer_workflow.html?highlight= > history, both of which I found by entering "history" into the home page > search box; however, both of those results are "advanced," so dig around > more for "how to get started" and "style and documentation guidlines"). > Happy hunting, and thanks for being interested in contributing! > > DLG > > On Wed, Nov 29, 2017 at 1:28 PM, Rushikesh Padia > wrote: > >> Actually I am a beginner and inexperienced. I want to know how did they >> start and what are they working on and how are they working. >> I am new to this, was my mail inappropriate ? >> On 30-Nov-2017 2:55 am, "David Goldsmith" >> wrote: >> >>> Please define "less experienced." Why do you ask? >>> >>> On Wed, Nov 29, 2017 at 1:20 PM, Rushikesh Padia < >>> padiarushi3012 at gmail.com> wrote: >>> >>>> Is there any less experienced or new contributor who just started >>>> contributing to this project ? Please respond. >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eulergaussriemann at gmail.com Wed Nov 29 17:08:47 2017 From: eulergaussriemann at gmail.com (David Goldsmith) Date: Wed, 29 Nov 2017 14:08:47 -0800 Subject: [Matplotlib-users] Need help from less experienced or new contributor In-Reply-To: References: Message-ID: No, not inappropriate per se, but given your motivation, you may want to post (and subscribe) to matplotlib-devel instead/also. Also, if you "dig around" at the main site--matplotlib.org--I think you'll be able to find a history of the package (if not, pretty sure Wikipedia has one), and definitely contributor guidance (e.g., https://matplotlib.org/devel/gitwash/development_workflow.html?highlight=history and https://matplotlib.org/devel/gitwash/maintainer_workflow.html?highlight=history, both of which I found by entering "history" into the home page search box; however, both of those results are "advanced," so dig around more for "how to get started" and "style and documentation guidlines"). Happy hunting, and thanks for being interested in contributing! DLG On Wed, Nov 29, 2017 at 1:28 PM, Rushikesh Padia wrote: > Actually I am a beginner and inexperienced. I want to know how did they > start and what are they working on and how are they working. > I am new to this, was my mail inappropriate ? > On 30-Nov-2017 2:55 am, "David Goldsmith" > wrote: > >> Please define "less experienced." Why do you ask? >> >> On Wed, Nov 29, 2017 at 1:20 PM, Rushikesh Padia < >> padiarushi3012 at gmail.com> wrote: >> >>> Is there any less experienced or new contributor who just started >>> contributing to this project ? Please respond. >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From story645 at gmail.com Wed Nov 29 21:16:38 2017 From: story645 at gmail.com (Hannah) Date: Wed, 29 Nov 2017 21:16:38 -0500 Subject: [Matplotlib-users] Need help from less experienced or new contributor In-Reply-To: References: Message-ID: I blogged about some of my experience of getting acclimated to matplotlib for my summer of code two years ago: http://story645.github.io/ >From this year, Katie's is at https://github.com/katierose1029/matplotlib_work_blog And Harshit's is https://patniharshit.github.io/ On Nov 29, 2017 5:17 PM, "David Goldsmith" wrote: No, not inappropriate per se, but given your motivation, you may want to post (and subscribe) to matplotlib-devel instead/also. Also, if you "dig around" at the main site--matplotlib.org--I think you'll be able to find a history of the package (if not, pretty sure Wikipedia has one), and definitely contributor guidance (e.g., https://matplotlib.org/ devel/gitwash/development_workflow.html?highlight=history and https://matplotlib.org/devel/gitwash/maintainer_workflow.html?highlight= history, both of which I found by entering "history" into the home page search box; however, both of those results are "advanced," so dig around more for "how to get started" and "style and documentation guidlines"). Happy hunting, and thanks for being interested in contributing! DLG On Wed, Nov 29, 2017 at 1:28 PM, Rushikesh Padia wrote: > Actually I am a beginner and inexperienced. I want to know how did they > start and what are they working on and how are they working. > I am new to this, was my mail inappropriate ? > On 30-Nov-2017 2:55 am, "David Goldsmith" > wrote: > >> Please define "less experienced." Why do you ask? >> >> On Wed, Nov 29, 2017 at 1:20 PM, Rushikesh Padia < >> padiarushi3012 at gmail.com> wrote: >> >>> Is there any less experienced or new contributor who just started >>> contributing to this project ? Please respond. >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> _______________________________________________ Matplotlib-users mailing list Matplotlib-users at python.org https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathoscope at netcourrier.com Thu Nov 30 01:18:58 2017 From: mathoscope at netcourrier.com (vincent_mathoscope) Date: Wed, 29 Nov 2017 23:18:58 -0700 (MST) Subject: [Matplotlib-users] size of the picture Message-ID: <1512022738170-0.post@n5.nabble.com> hi for the book iwrite i need fonts in size 10 i put this size to the fonts and the exported picture, when included in my TeXmacs document without changing the size, present fonts that fits approximatively to this size of 10 but my pictures are really to big ; if i reduce them (they are png) then of course the fonts are reduced also i have been searching on internet since 2 days, looking for the right instruction to fix the size of the picture i did not find my answer here : https://stackoverflow.com/questions/8775622/exact-figure-size-in-matplotlib-with-title-axis-labels here the topic seemed to be mine : http://scipy-cookbook.readthedocs.io/items/Matplotlib_AdjustingImageSize.html but this code, just copy-pasted from this link : gave this message : AttributeError: 'Figure' object has no attribute 'set_figsize_inches' of course i can fix the font to some random value say 24 and reduce the picture to a random % and, by trials and approximations, find the right size and the right % so that the text in my pictures seem to be 10 i'm sure it must exist a more satisfying way but can not find it i am just missing this point to start working thanks if you have ideas. ----- ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From mathoscope at netcourrier.com Thu Nov 30 01:20:50 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Thu, 30 Nov 2017 07:20:50 +0100 Subject: [Matplotlib-users] size of the picture exported from matplotlib In-Reply-To: References: <7508D5BF-EA0D-49C6-B352-B0DE3C97BE41@inria.fr> Message-ID: <2B4E166B-83DF-4C46-9BA2-BB0E43C27D9B@netcourrier.com> hii for the book iwrite i need fonts in size 10 i put this size to the fonts and the exported picture, when included in my TeXmacs document without changing the size, present fonts that fits approximatively to this size of 10 but my pictures are really to big ; if i reduce them (they are png) then of course the fonts are reduced also i have been searching on internet since 2 days, looking for the right instruction to fix the size of the picture i did not find my answer here : https://stackoverflow.com/questions/8775622/exact-figure-size-in-matplotlib-with-title-axis-labels here the topic seemed to be mine : http://scipy-cookbook.readthedocs.io/items/Matplotlib_AdjustingImageSize.html but this code, just copy-pasted from this link : import pylab F = pylab.gcf() F.set_figsize_inches( (DefaultSize[0]*2, DefaultSize[1]*2) ) gave this message : AttributeError: 'Figure' object has no attribute 'set_figsize_inches' of course i can fix the font to some random value say 24 and reduce the picture to a random % and, by trials and approximations, find the right size and the right % so that the text in my pictures seem to be 10 i'm sure it must exist a more satisfying way but can not find it i am just missing this point to start working thanks if you have ideas. ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Thu Nov 30 01:26:48 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Wed, 29 Nov 2017 22:26:48 -0800 Subject: [Matplotlib-users] size of the picture In-Reply-To: <1512022738170-0.post@n5.nabble.com> References: <1512022738170-0.post@n5.nabble.com> Message-ID: <7216ECAB-6310-4F9B-A328-44DD856D4D5D@uvic.ca> ```python fig, ax = plt.subplots(figsize=(5,3)) ``` will give a figure that is 5 inches wide by 3 inches tall. Cheers, Jody > On Nov 29, 2017, at 22:18 PM, vincent_mathoscope wrote: > > hi > for the book iwrite i need fonts in size 10 > i put this size to the fonts and the exported picture, when included in my > TeXmacs document without changing the size, present fonts that fits > approximatively to this size of 10 > but my pictures are really to big ; if i reduce them (they are png) then of > course the fonts are reduced also > i have been searching on internet since 2 days, looking for the right > instruction to fix the size of the picture > i did not find my answer here : > https://stackoverflow.com/questions/8775622/exact-figure-size-in-matplotlib-with-title-axis-labels > > here the topic seemed to be mine : > http://scipy-cookbook.readthedocs.io/items/Matplotlib_AdjustingImageSize.html > > but this code, just copy-pasted from this link : > > gave this message : > AttributeError: 'Figure' object has no attribute 'set_figsize_inches' > > of course i can fix the font to some random value say 24 and reduce the > picture to a random % and, by trials and approximations, find the right size > and the right % so that the text in my pictures seem to be 10 > > i'm sure it must exist a more satisfying way but can not find it > > i am just missing this point to start working > > thanks if you have ideas. > > > > ----- > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From mathoscope at netcourrier.com Thu Nov 30 01:40:29 2017 From: mathoscope at netcourrier.com (vincent_mathoscope) Date: Wed, 29 Nov 2017 23:40:29 -0700 (MST) Subject: [Matplotlib-users] size of the picture In-Reply-To: <7216ECAB-6310-4F9B-A328-44DD856D4D5D@uvic.ca> References: <1512022738170-0.post@n5.nabble.com> <7216ECAB-6310-4F9B-A328-44DD856D4D5D@uvic.ca> Message-ID: <1512024029855-0.post@n5.nabble.com> thank you Jody i tried quickly your code before going to work this code : just gave an empty picture with some graduations on the axes that were not coded in my picture if you have a cuple of seconds to explain a bit longer that will be useful for me otherwise i take time to look at it this evening ----- ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From vincent.adrien at gmail.com Thu Nov 30 02:42:57 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Wed, 29 Nov 2017 23:42:57 -0800 Subject: [Matplotlib-users] size of the picture In-Reply-To: <1512024029855-0.post@n5.nabble.com> References: <1512022738170-0.post@n5.nabble.com> <7216ECAB-6310-4F9B-A328-44DD856D4D5D@uvic.ca> <1512024029855-0.post@n5.nabble.com> Message-ID: <37b7fba7-7e7e-f02b-9745-07ac1a431ad7@gmail.com> Hi Vincent, Here is a small snippet of code on the very same idea that Jody already suggested, but this time with examples of texts, labels, etc. :). ```python import matplotlib.pyplot as plt plt.ion() # if you do not want displaying of figures to be blocking # Default cosmetick tweaks. Note than one could also define the default # figure size, as well as the weight of the fonts, etc. plt.style.use(["default"]) # reset: better safe than sorry plt.rcParams["font.size"] = 10 # in points plt.rcParams["axes.labelsize"] = 10 # in points plt.rcParams["axes.titlesize"] = 10 # in points # This is what you may looking for. Knowing the size of the figures # that you produce, you should be able to ask LaTeX to use the exact # same physical dimensions :). width, height = (4, 3) # in inches (NB: 72 points per inch) fig, ax = plt.subplots(figsize=(width, height)) # Dummy data (I was too lazy to import Numpy...) x = [-1, 0, 1, 2] y = [val**2 for val in x] ax.plot(x, y, label="A line") # Exercise most of the possible text of a plot ax.set_xlabel("$x$") ax.set_ylabel("$y = x^2$") ax.set_title("A simple figure") ax.legend() fig.tight_layout() # to nicely fit the subplot(s) in the figure # Record the figure in the format that you prefer fig.savefig("my_figure.png", dpi=600) fig.savefig("my_figure.pdf") ``` If you have more general questions about the usage of Matplotlib, you may also find some useful informations in [here](https://matplotlib.org/tutorials/index.html) Best regards, Adrien On 11/29/2017 10:40 PM, vincent_mathoscope wrote: > thank you Jody > i tried quickly your code before going to work > this code : > > just gave an empty picture with some graduations on the axes that were not > coded in my picture > if you have a cuple of seconds to explain a bit longer that will be useful > for me > otherwise i take time to look at it this evening > > > > ----- > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From jie.li_x at hotmail.com Thu Nov 30 04:55:42 2017 From: jie.li_x at hotmail.com (jlx) Date: Thu, 30 Nov 2017 02:55:42 -0700 (MST) Subject: [Matplotlib-users] autoscale y axis in different [x1,x2] range Message-ID: <1512035742729-0.post@n5.nabble.com> hey everyone, I meet a problem about autoscale. I change the x axis range so that I can see the details of the curve, but y axis range is always the same, it does not change automatically to zoom in. I tried autoscale on and set_autoscale_view, but do not work, could you help me about that? the following are curves at whole x range and [x1,x2] range: So how to make the black, red and blue curves fit the subplot window automatically? Thank you! -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From mail.python.org at gethmann.org Thu Nov 30 05:01:12 2017 From: mail.python.org at gethmann.org (Julian) Date: Thu, 30 Nov 2017 11:01:12 +0100 Subject: [Matplotlib-users] size of the picture In-Reply-To: <37b7fba7-7e7e-f02b-9745-07ac1a431ad7@gmail.com> References: <1512022738170-0.post@n5.nabble.com> <7216ECAB-6310-4F9B-A328-44DD856D4D5D@uvic.ca> <1512024029855-0.post@n5.nabble.com> <37b7fba7-7e7e-f02b-9745-07ac1a431ad7@gmail.com> Message-ID: <1ee5e4ae-86a2-4aea-4d78-136efe906c32@gethmann.org> Hi Vincent, To get to know the width in LaTeX you can use the commands ```LaTeX \showthe\textwidth ``` or ```LaTeX \showthe\columnwidth ``` which show you the value you then divide by 72 to get the value you want to take for the width in Adrien's answer. Best regards, Julian On 11/30/2017 08:42 AM, vincent.adrien at gmail.com wrote: > Hi Vincent, > > Here is a small snippet of code on the very same idea that Jody already > suggested, but this time with examples of texts, labels, etc. :). > > ```python > import matplotlib.pyplot as plt > plt.ion()? # if you do not want displaying of figures to be blocking > > # Default cosmetick tweaks. Note than one could also define the default > # figure size, as well as the weight of the fonts, etc. > plt.style.use(["default"])? # reset: better safe than sorry > plt.rcParams["font.size"] = 10? # in points > plt.rcParams["axes.labelsize"] = 10? # in points > plt.rcParams["axes.titlesize"] = 10? # in points > > # This is what you may looking for. Knowing the size of the figures > # that you produce, you should be able to ask LaTeX to use the exact > # same physical dimensions :). > width, height = (4, 3)? # in inches (NB: 72 points per inch) > fig, ax = plt.subplots(figsize=(width, height)) > > # Dummy data (I was too lazy to import Numpy...) > x = [-1, 0, 1, 2] > y = [val**2 for val in x] > ax.plot(x, y, label="A line") > > # Exercise most of the possible text of a plot > ax.set_xlabel("$x$") > ax.set_ylabel("$y = x^2$") > ax.set_title("A simple figure") > ax.legend() > > fig.tight_layout()? # to nicely fit the subplot(s) in the figure > > # Record the figure in the format that you prefer > fig.savefig("my_figure.png", dpi=600) > fig.savefig("my_figure.pdf") > ``` > > If you have more general questions about the usage of Matplotlib, you > may also find some useful informations in > [here](https://matplotlib.org/tutorials/index.html) > > Best regards, > Adrien > > On 11/29/2017 10:40 PM, vincent_mathoscope wrote: >> thank you Jody >> i tried quickly your code before going to work >> this code : >> >> just gave an empty picture with some graduations on the axes that were >> not >> coded in my picture >> if you have a cuple of seconds to explain a bit longer that will be >> useful >> for me >> otherwise i take time to look at it this evening >> >> >> >> ----- >> ???????? ?????????????????????????? >> ?????????????????? Vincent Douce >> ??????????????? :=: Mathoscope :=: >> ????????????? http://mathoscope.xyz >> ????????????????? 06?13?11?07?26 >> ?????????? Bagn?res de Bigorre 65200 >> -- >> Sent from: >> http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From solarjoe at posteo.org Thu Nov 30 07:14:50 2017 From: solarjoe at posteo.org (Joe) Date: Thu, 30 Nov 2017 13:14:50 +0100 Subject: [Matplotlib-users] autoscale y axis in different [x1,x2] range In-Reply-To: <1512035742729-0.post@n5.nabble.com> References: <1512035742729-0.post@n5.nabble.com> Message-ID: <4011346184f7f261807d78df50ce2b61@posteo.de> Did you use a shared x axis for the plots? (sharex? see also https://matplotlib.org/examples/pylab_examples/shared_axis_demo.html Am 30.11.2017 10:55 schrieb jlx: > hey everyone, I meet a problem about autoscale. > > I change the x axis range so that I can see the details of the curve, > but y > axis range is always the same, it does not change automatically to zoom > in. > > I tried autoscale on and set_autoscale_view, but do not work, could you > help > me about that? > > the following are curves at whole x range and [x1,x2] range: > > > > > So how to make the black, red and blue curves fit the subplot window > automatically? > > > Thank you! > > > > > -- > Sent from: > http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From efiring at hawaii.edu Thu Nov 30 18:28:07 2017 From: efiring at hawaii.edu (Eric Firing) Date: Thu, 30 Nov 2017 13:28:07 -1000 Subject: [Matplotlib-users] autoscale y axis in different [x1,x2] range In-Reply-To: <1512035742729-0.post@n5.nabble.com> References: <1512035742729-0.post@n5.nabble.com> Message-ID: On 2017/11/29 11:55 PM, jlx wrote: > hey everyone, I meet a problem about autoscale. > > I change the x axis range so that I can see the details of the curve, but y > axis range is always the same, it does not change automatically to zoom in. > > I tried autoscale on and set_autoscale_view, but do not work, could you help > me about that? > > the following are curves at whole x range and [x1,x2] range: > > > > > So how to make the black, red and blue curves fit the subplot window > automatically? You will need to write a function to calculate the appropriate y limits based on your input data and the x limits, and then connect it to the 'xlim_changed' event. Something like this is illustrated here: http://matplotlib.org/gallery/event_handling/resample.html#sphx-glr-gallery-event-handling-resample-py Eric