Hello: Being matplotlib naturally a graphical package, one expects that it must have support for graphics. The problem lies that in GTK based desktop profiles the USE flag gtk is enabled by default, but matplotlib does not use gtk as USE flag. It uses either gtk2 or gtk3 (see "equery hasuse matplotlib"). I was having problems because matplotlib didn't show plots in my system, but this is now fixed when I added the gtk3 flag to my build (see https://forums.gentoo.org/viewtopic-t-1112352-highlight-.html). I don't know if in qt based desktop profiles (e.g. plasma) the qt5 flag is enabled by default or not. So the problem lies in the USE flags. As there are many variations of gtk USE flags I could only point the problem but not the solution. Could a fix be to post a message after installation warning the user to emerge with one of the gt2, gtk3 or qt5 flags? A much better solution would be to implement, like so many other packages, a required USE flag if one of the above is not detected, e.g. when a package needs a flag that is not globally defined and the user is asked to modify the package.use -automatically or not- and making an etc-update afterwards.
ERRATA instead of "equery hasuse matplotlib" the command is "equery uses matplotlib"