Re: [Matplotlib-users] Plotting issue using recent matplotlib
On Tuesday, May 15, 2012, Gökhan Sever wrote: > Hello, > > I have encountered a weird plotting issue recently using a recent mpl > clone. See the linked pdfs for better demonstration of the issue: > > http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_newmpl.pdf > http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_oldmpl.pdf > > > newmpl file is created using the latest master branch (cloned and setup > today) > oldmpl is created using mpl v1.1.0 ( > https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.1.0.tar.gz > ) > > Scroll down to page 4 in each file and you will see the wrong > plotted behavior of alwp_lcl (black line) variable on newmpl file comparing > to the correct version that is shown on oldmpl. > > I was trying to figure out a way to correct this and I raised y-axis max > to 2400 and then the line looks fine. However I have other data that show > similar wrong behaviors, so I decided to try earlier mpl versions since I > know that those plots were looking correct earlier (at least a few months > back). Trying v1.1.x branch gave me the same results. Note that these data > contain "nans". Are nan handling changed in recent mpl code or the way the > data is plotted out of margins? I can't reproduce this with synthetic data. > > Any ideas as to what could be going wrong here? > > Thanks. > > -- > Gökhan > I do recall some changes were made for v1.1.x with regards to autoscaling. Another change was also made with respect to Bbox clipping. I can't recall enough details to know if they are a part of this issue. Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Plotting issue using recent matplotlib
Hello, I have encountered a weird plotting issue recently using a recent mpl clone. See the linked pdfs for better demonstration of the issue: http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_newmpl.pdf http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_oldmpl.pdf newmpl file is created using the latest master branch (cloned and setup today) oldmpl is created using mpl v1.1.0 ( https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.1.0.tar.gz) Scroll down to page 4 in each file and you will see the wrong plotted behavior of alwp_lcl (black line) variable on newmpl file comparing to the correct version that is shown on oldmpl. I was trying to figure out a way to correct this and I raised y-axis max to 2400 and then the line looks fine. However I have other data that show similar wrong behaviors, so I decided to try earlier mpl versions since I know that those plots were looking correct earlier (at least a few months back). Trying v1.1.x branch gave me the same results. Note that these data contain "nans". Are nan handling changed in recent mpl code or the way the data is plotted out of margins? I can't reproduce this with synthetic data. Any ideas as to what could be going wrong here? Thanks. -- Gökhan -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] howto get minor ticks?
Neal, I can't run your script as is, but something as simple as this show work: import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.set_xscale('log') ax.xaxis.grid(True, which='major') ax.xaxis.grid(True, which='minor') plt.show() On Tue, May 15, 2012 at 10:18 AM, Neal Becker wrote: > In the following code snippet (not a complete example), I get the > dashed lines for the minor ticks on the y (log) axis, but on the x axis, I > only > got the major ticks lines. How do I get minor lines to show up? > > (Previously, I tried without the MultipleLocator and set_minor_locator, but > still got only major x axis lines plotted) > > import matplotlib.pyplot as plt > fig = plt.figure() > ax = fig.add_subplot(111) > > ax.semilogy (h1.buckets(), h1.cumulative()) > ax.semilogy (h2.buckets(), h2.inv_cumulative()) > from matplotlib.ticker import MultipleLocator > minorLocator = MultipleLocator(5) > ax.xaxis.set_minor_locator(minorLocator) > plt.grid(b=True, which='major', linestyle='solid') > plt.grid(b=True, which='minor', linestyle='dashed') > plt.show() > > > > -- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] howto get minor ticks?
In the following code snippet (not a complete example), I get the dashed lines for the minor ticks on the y (log) axis, but on the x axis, I only got the major ticks lines. How do I get minor lines to show up? (Previously, I tried without the MultipleLocator and set_minor_locator, but still got only major x axis lines plotted) import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.semilogy (h1.buckets(), h1.cumulative()) ax.semilogy (h2.buckets(), h2.inv_cumulative()) from matplotlib.ticker import MultipleLocator minorLocator = MultipleLocator(5) ax.xaxis.set_minor_locator(minorLocator) plt.grid(b=True, which='major', linestyle='solid') plt.grid(b=True, which='minor', linestyle='dashed') plt.show() -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Cannot find test_backend_svg and others while running tests.py
I use up-to-date Debian testing (wheezy) with the amd64 architecture and Debian's python3.2. I install matplotlib from the tarball matplotlib-matplotlib-v1.1.0-684-ge87374e.tar.gz Before the current install, I had also on my system Debian's python-matplotlib and python-matplotlib-data packages. They contain some of the same files as the tarball (/etc/matplotlibrc). I have completely removed the two Debian packages. My Debian system includes the packages python3-tk, tck8.5, tcl8.5-dev, tk8.5, and tk-dev. I did a new matplotlib install, starting by unpacking the tarball. In /usr/local/lib/python3.2/dist-packages/matplotlib/tests/test_text.py in test_afm_kerning, I added before the assert: xxx = afm.string_width_height('VAVAVAVAVAVA') print(xxx) The results are: > python3.2 Python 3.2.3rc2 (default, Mar 21 2012, 05:47:04) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.test() ..K./usr/lib/python3/dist-packages/nose/tools.py:82: ResourceWarning: unclosed file <_io.BufferedRandom name=3> pass ./usr/lib/python3.2/subprocess.py:650: ResourceWarning: unclosed file <_io.FileIO name=6 mode='rb'> _cleanup() /usr/lib/python3.2/subprocess.py:650: ResourceWarning: unclosed file <_io.FileIO name=8 mode='rb'> _cleanup() Many "."s and "K"s are printed. == FAIL: matplotlib.tests.test_text.test_afm_kerning -- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/usr/local/lib/python3.2/dist-packages/matplotlib/tests/test_text.py", line 109, in test_afm_kerning assert afm.string_width_height('VAVAVAVAVAVA') == (7174.0, 718) AssertionError: AssertionError: >> begin captured stdout << - (8004.0, 718) - >> end captured stdout << -- -- Ran 1091 tests in 312.866s FAILED (KNOWNFAIL=275, failures=1) /usr/local/lib/python3.2/dist-packages/matplotlib/__init__.py:937: /UserWarning: This call to matplotlib.use() has no effect because the the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time. if warn: warnings.warn(_use_error_msg) False >>> === Here is one of matplotlib's simple sample programs. It works. #! /usr/bin/env python3.2 from pylab import * t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, linewidth=1.0) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) show() -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Cannot find test_backend_svg and others while running tests.py
On 05/15/2012 10:15 AM, Edward C. Jones wrote: > Michael Droettboom said > > > Are you running the tests from the source directory? That often > results in failures that look like this. > > Yes, I did that. Some Googling found the correct way to do it: > > python3.2 > >>> import matplotlib > >>> matplotlib.test() > ..K./usr/lib/python3/dist-packages/nose/tools.py:82: > ResourceWarning: unclosed file<_io.BufferedRandom name=3> > pass > ./usr/lib/python3.2/subprocess.py:650: ResourceWarning: unclosed file > <_io.FileIO name=6 mode='rb'> > _cleanup() > /usr/lib/python3.2/subprocess.py:650: ResourceWarning: unclosed file > <_io.FileIO name=8 mode='rb'> > _cleanup() > > Many "."s and "K"s are output. The K's are probably because some requirement of the test framework (ghostscript or inkscape) is not being found on your machine. > > FAIL: matplotlib.tests.test_text.test_afm_kerning > -- > Traceback (most recent call last): > File "/usr/lib/python3/dist-packages/nose/case.py", line 198, in runTest > self.test(*self.arg) > File > "/usr/local/lib/python3.2/dist-packages/matplotlib/tests/test_text.py", line > 107, in test_afm_kerning > assert afm.string_width_height('VAVAVAVAVAVA') == (7174.0, 718) > AssertionError > > -- > Ran 1091 tests in 310.441s > > FAILED (KNOWNFAIL=275, failures=1) > False > This is a new test as of yesterday. Can you add a print to figure out what afm.string_width_height() returns? I'm curious as to what way this is failing on your machine. Mike -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Cannot find test_backend_svg and others while running tests.py
Michael Droettboom said > Are you running the tests from the source directory? That often results in failures that look like this. Yes, I did that. Some Googling found the correct way to do it: python3.2 >>> import matplotlib >>> matplotlib.test() ..K./usr/lib/python3/dist-packages/nose/tools.py:82: ResourceWarning: unclosed file <_io.BufferedRandom name=3> pass ./usr/lib/python3.2/subprocess.py:650: ResourceWarning: unclosed file <_io.FileIO name=6 mode='rb'> _cleanup() /usr/lib/python3.2/subprocess.py:650: ResourceWarning: unclosed file <_io.FileIO name=8 mode='rb'> _cleanup() Many "."s and "K"s are output. FAIL: matplotlib.tests.test_text.test_afm_kerning -- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/usr/local/lib/python3.2/dist-packages/matplotlib/tests/test_text.py", line 107, in test_afm_kerning assert afm.string_width_height('VAVAVAVAVAVA') == (7174.0, 718) AssertionError -- Ran 1091 tests in 310.441s FAILED (KNOWNFAIL=275, failures=1) False -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Cannot find test_backend_svg and others while running tests.py
Are you running the tests from the source directory? That often results in failures that look like this. Mike On 05/14/2012 06:11 PM, Edward C. Jones wrote: > I use up-to-date Debian testing (wheezy) with an amd64 architecture. I > am trying to use matplotlib with Python 3.2, I downloaded > matplotlib-matplotlib-v1.1.0-684-ge87374e.tar.gz > I expanded the tarball and did > python3.2 setup.py build > and, as root, > python3.2 setup.py install > > When I tried to run > python3.2 tests.py > I had two types of error. First the files in lib/dateutil: parser.py, > rrule.py, etc. had not been run through 2to3. I removed back-quotes, > used the function-call form for exceptions, and fixed some import > statements. > > After fixing these errors I get 13 messages like: > > ERROR: Failure: AttributeError ('module' object has no attribute > 'test_backend_svg') > -- > Traceback (most recent call last): > File "/usr/lib/python3/dist-packages/nose/failure.py", line 37, in > runTest > raise self.exc_class(self.exc_val).with_traceback(self.tb) > File "/usr/lib/python3/dist-packages/nose/loader.py", line 379, in > loadTestsFromName > module = resolve_name(addr.module) > File "/usr/lib/python3/dist-packages/nose/util.py", line 331, in > resolve_name > obj = getattr(obj, part) > AttributeError: 'module' object has no attribute 'test_backend_svg' > > These tests are all in build/lib.linux-x86_64-3.2/matplotlib/tests. > > There is a similar problem in > http://sourceforge.net/mailarchive/message.php?msg_id=28398373 > > What is the problem and the fix? > > > -- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users