Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301062 - dev-python/matplotlib-0.99.1.1 fails to plot masked data
Summary: dev-python/matplotlib-0.99.1.1 fails to plot masked data
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 08:20 UTC by Paweł Rumian
Modified: 2010-07-13 15:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
testfig.pdf (testfig.pdf,13.17 KB, application/octet-stream)
2010-05-31 22:55 UTC, Paweł Rumian
Details
testfig.png (testfig.png,47.16 KB, image/png)
2010-05-31 22:56 UTC, Paweł Rumian
Details
matplotlib-0.99.3.ebuild (matplotlib-0.99.3.ebuild,5.39 KB, text/plain)
2010-06-03 19:23 UTC, Sébastien Fabbro (RETIRED)
Details
Log of building from source tar.gz (build_source.log,52.72 KB, text/plain)
2010-06-03 21:14 UTC, Paweł Rumian
Details
Log of installing from source tar.gz (install_source.log,26.31 KB, text/plain)
2010-06-03 21:19 UTC, Paweł Rumian
Details
Log of build and install from portage (build_portage_orig.log,81.35 KB, text/plain)
2010-06-03 21:20 UTC, Paweł Rumian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paweł Rumian 2010-01-15 08:20:12 UTC
Matplotlib won't plot _masked_ data with lines ('-', '--' and so on), no matter what the backend is used. 
When using marks instead of lines everything is OK. 

Sometimes the line can be seen while moving the plot - quick examples:
no move: http://img524.imageshack.us/img524/5696/61571712.png
slightly right (no change): http://img94.imageshack.us/img94/6722/44916983.png
more (green line appears): http://img27.imageshack.us/img27/522/91772530.png
even more (disappears behind the edge):
http://img246.imageshack.us/img246/9726/24229795.png
to the right (another part suddenly appears):
http://img190.imageshack.us/img190/5697/69412483.png

To me it seems to be a Gentoo-related bug - I tried three Gentoo machines with different configurations and the problem happens everywhere, while it is not confirmed by other matplotlib users.

Reproducible: Always

Steps to Reproduce:
1. Go to http://matplotlib.sourceforge.net/examples/pylab_examples/masked_demo.html
2. Execute the example
3.

Actual Results:  
The green masked sinus line is not plotted.

Expected Results:  
The line should be plotted as shown in the example.

Portage 2.2_rc61 (default/linux/x86/10.0/desktop, gcc-4.3.4, glibc-2.10.1-r1, 2.6.28-gentoo-r5 i686)
=================================================================                                   
System uname: Linux-2.6.28-gentoo-r5-i686-AMD_Athlon-tm-_XP_2500+-with-gentoo-2.0.1                 
Timestamp of tree: Thu, 14 Jan 2010 21:30:01 +0000                                                  
distcc 3.1 i686-pc-linux-gnu [disabled]                                                             
ccache version 2.4 [enabled]                                                                        
app-shells/bash:     4.0_p35                                                                        
dev-java/java-config: 2.1.9-r2                                                                      
dev-lang/python:     2.6.4                                                                          
dev-util/ccache:     2.4-r7                                                                         
dev-util/cmake:      2.6.4-r3                                                                       
sys-apps/baselayout: 2.0.1                                                                          
sys-apps/openrc:     0.6.0                                                                          
sys-apps/sandbox:    2.2                                                                            
sys-devel/autoconf:  2.13, 2.63-r1                                                                  
sys-devel/automake:  1.8.5-r3, 1.9.6-r2, 1.10.2                                                     
sys-devel/binutils:  2.18-r3                                                                        
sys-devel/gcc-config: 1.4.1                                                                         
sys-devel/libtool:   2.2.6b                                                                         
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="pl"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa bash-completion berkdb bluetooth branding bzip2 bzlib cairo cddb cdr cli consolekit cracklib crypt cups cxx dbus dga dri dts dvd dvdr emboss encode exif fam ffmpeg flac foomaticdb fortran gif gimp gnuplot gnutls gpm gtk hal iconv ieee1394 imagemagick imap imlib ipv6 jabber java jpeg kde kipi lame latex libnotify lm_sensors loop-aes mad mikmod mmx mmxext mng modules mp3 mp4 mpeg mplayer mudflap musepack mysql ncurses nls nptl nptlonly nsplugin ogg opengl pam pcre pdf perl png ppds pppd python qt3support qt4 quicktime raw readline reflection rss sdl semantic-desktop session spell spl sse ssl startup-notification svg sysfs syslog tcpd thunar tiff truetype unicode usb vorbis webkit win32codecs x264 x86 xine xml xorg xulrunner xv xvid zlib" ALSA_CARDS="emu10k1 intel8x0 mpu401" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Paweł Rumian 2010-01-15 18:20:56 UTC
I've just built and installed matplotlib from the tarball and it works flawlessly. So it is certainly a bug in Gentoo.
Comment 2 Sébastien Fabbro (RETIRED) gentoo-dev 2010-01-15 20:11:00 UTC
I don't experiment this on my ~amd64 box, it works fine with the package in the tree, and the demo gives the same result as in the web page mentioned or in other linux boxes.

Could someone else confirm?
Comment 3 Paweł Rumian 2010-01-21 20:44:21 UTC
Chcecked another machine and the problem still exists.
It was, however, x86 - like all the previous boxes with this problem.

Anyway, I don't suppose architecture, but who knows?
Comment 4 Sébastien Fabbro (RETIRED) gentoo-dev 2010-02-26 15:26:08 UTC
I can not reproduce this bug on ~amd64. Could one of the x86 team try it out?
Thanks
Comment 5 Christian Faulhammer (RETIRED) gentoo-dev 2010-03-04 07:51:29 UTC
(In reply to comment #4)
> I can not reproduce this bug on ~amd64. Could one of the x86 team try it out?

 Reproducable as the green line is not shown, the blue (masked?) dots are there.
Comment 6 Paweł Rumian 2010-05-03 16:04:46 UTC
I've tried to debug this, but with no effect.

As far as I can tell this bug is independent of the patches - disbaling them makes no effect.
Commenting out the FHS parts of the ebuild also didn't help.

I'd like to help finding the reasons of this strange behaviour, but I don't know where to seek now.
Comment 7 Sébastien Fabbro (RETIRED) gentoo-dev 2010-05-04 15:59:55 UTC
It is probably not an architecture problem, but from dependencies of matplotlib, may be in the backend. Could you try with different backends and report, so we could point out which dependency causes trouble?

Thanks
Comment 8 Sébastien Fabbro (RETIRED) gentoo-dev 2010-05-31 20:25:29 UTC
Paweł, could you try with matplotlib-0.99.1.1-r2?
Thanks.
Comment 9 Paweł Rumian 2010-05-31 22:55:00 UTC
(In reply to comment #8)
> Paweł, could you try with matplotlib-0.99.1.1-r2?
> Thanks.
 
Unfortunately the bug still persits with -r2.

I'm finishing my thesis now and have very little time for debugging, but I've tried with other backends and:
- there's no difference with GTKAgg, GTKCairo, TkAgg, WXAgg (green line not being plotted)
- the situation is even worse with GTK, GTKCairo, WX (no only the green line is not plotted but also part of the blue dots)
- it also doesn't work with savefig() and backends like PDF, SVG, PS, Cairo - I'm attaching an example PDF and PNG file.

I'm constantly working with matplotlib built from sources and it works OK, so I'm wondering if it can be the backend causing this strange behaviour.
Comment 10 Paweł Rumian 2010-05-31 22:55:54 UTC
Created attachment 233735 [details]
testfig.pdf
Comment 11 Paweł Rumian 2010-05-31 22:56:15 UTC
Created attachment 233737 [details]
testfig.png
Comment 12 Sébastien Fabbro (RETIRED) gentoo-dev 2010-06-03 19:23:27 UTC
Created attachment 234025 [details]
matplotlib-0.99.3.ebuild

please try matplotlib-0.99.3 just bumped in portage, and if it does not work, could you give a try with this one attached, which uses the pycxx bundled into matplotlib instead of the system one?
Comment 13 Paweł Rumian 2010-06-03 20:34:37 UTC
I'm afraid that they still doesn't work - neither the 0.99.3 from portage, nor the attached one...
Comment 14 Sébastien Fabbro (RETIRED) gentoo-dev 2010-06-03 20:47:04 UTC
Hmm I wonder where that come from.
Could you build it from scratch as you now do and post your build log, something like python setup.py build &> build.log? Also post your build log from the one in portage.

Thanks.

Comment 15 Paweł Rumian 2010-06-03 21:02:00 UTC
(In reply to comment #14)
> Hmm I wonder where that come from.

You're not alone :)
I'm attaching the build logs...


Comment 16 Paweł Rumian 2010-06-03 21:14:01 UTC
Created attachment 234037 [details]
Log of building from source tar.gz

Matplotlib built this way plots masked data with no problems.
Comment 17 Paweł Rumian 2010-06-03 21:19:27 UTC
Created attachment 234039 [details]
Log of installing from source tar.gz

This is what I get after building from source tar.gz and doing python setup.py install
After this I get working (==plotting masked data) matplotlib.
Comment 18 Paweł Rumian 2010-06-03 21:20:58 UTC
Created attachment 234041 [details]
Log of build and install from portage

This is what I get after doing simple 'emerge matplotlib'.

After this matplotlib WON'T plot masked data.
Comment 19 Sébastien Fabbro (RETIRED) gentoo-dev 2010-06-03 21:40:49 UTC
Could you try those two things:
* build from source using the same flags as in your make.conf (both CFLAGS and CXXFLAGS)? and see if masking still works
* comment out the sed test in matplotlib ebuild:
 sed -i \
        -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
        -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
        setup.py || die "sed setup.py failed"
Comment 20 Paweł Rumian 2010-06-03 22:15:27 UTC
(In reply to comment #19)
> Could you try those two things:
> * build from source using the same flags as in your make.conf (both CFLAGS and
> CXXFLAGS)? and see if masking still works

That was it! The silent-killing '-O2' flag!

After compiling from source with CFLAGS and CXXFLAGS set the problem occured, so I was adding and removing flags one by one, and found that it was the '-O2' flag that caused the problem...
Comment 21 Paweł Rumian 2010-06-03 22:19:55 UTC
Of course I probably would never debug this by myself, so thank you very much Sébastien!
Comment 22 Sébastien Fabbro (RETIRED) gentoo-dev 2010-06-03 23:15:03 UTC
I still wonder why -O2 would make it fail on x86 and not amd64. May be it is also something to deal with numpy version. One last test, could you try with numpy-1.4.1?
I need to lower down optimization flags for matplotlib on x86, so one last check: test it with -O1.

Thanks for your contribution!
Comment 23 Paweł Rumian 2010-06-03 23:25:28 UTC
Yup, -O1 works, -O2 does not.

One more thing - may it be a gcc issue? If it is possible I can try with another gcc version.
I will also try numpy 1.4.1, but - if you wouldn't mind - tommorow :)

Comment 24 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-04 10:13:26 UTC
Could you check which flag enabled by -O2 causes this problem?

`info gcc` from GCC 4.4.3 says:
     `-O2' turns on all optimization flags specified by `-O'.  It also
     turns on the following optimization flags:
          -fthread-jumps
          -falign-functions  -falign-jumps
          -falign-loops  -falign-labels
          -fcaller-saves
          -fcrossjumping
          -fcse-follow-jumps  -fcse-skip-blocks
          -fdelete-null-pointer-checks
          -fexpensive-optimizations
          -fgcse  -fgcse-lm
          -findirect-inlining
          -foptimize-sibling-calls
          -fpeephole2
          -fregmove
          -freorder-blocks  -freorder-functions
          -frerun-cse-after-loop
          -fsched-interblock  -fsched-spec
          -fschedule-insns  -fschedule-insns2
          -fstrict-aliasing -fstrict-overflow
          -ftree-switch-conversion
          -ftree-pre
          -ftree-vrp
Comment 25 Paweł Rumian 2010-07-13 15:07:29 UTC
After one of the last world updates it started to work. 

I couldn't remember what exactly was upgraded in two last weeks, but today I've rebuilt matplotlib to debug it further, and immediately all the masked lines started to be plotted correctly.

Now both matplotlib-0.99.3 and 1.0.0 plot masked lines without any problem.

I've tried downgrading to numpy-1.3.0 to see if this was not the case, but the lines are still there. 

So I think this ticket can be closed -- seeking for the reasons of a bug that is not valid anymore seems like an overkill to me.

Thanks for the support!
Comment 26 Christian Faulhammer (RETIRED) gentoo-dev 2010-07-13 15:17:03 UTC
(In reply to comment #25)
>  Thanks for the support!

 We find solutions to problems by doing something completely different. :) Thanks for your feedback, closing.