matplotlib generated PDF cannot be viewed in acrobat reader

淺唱寂寞╮ 提交于 2019-11-30 22:59:51

After chasing my own bug in matplotlib I figured out based on this post and the referral the OP makes at matplotlib site that chasing bugs in matplotlib can be done with cairo. pip install cairo. Then on top of all other MPL imports add:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import ...

import matplotlib
matplotlib.use("cairo")

from matplotlib.backends.backend_pdf import PdfPages
..etc.

otherwise the chase will fail because the backend is already set and loaded....

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!