Solved by sonsus in post #8 
              
              
                It was the problem of old matplotlib 2.2.3 (conda-forge) with pytorch 1.0.1-cuda_9.0.176 (conda -c pytorch) . Upgrading it to matplotlib 3.0.3 resolved the problem.