简体   繁体   English

版本升级后在matplotlib中没有绘图

[英]No plotting in matplotlib after version upgrade

I just updated matplotlib to 1.1.0 on a server running ubuntu 10.04 LTS in order to play better with pandas. 我只是在运行ubuntu 10.04 LTS的服务器上将matplotlib更新为1.1.0,以便更好地与熊猫一起玩。 Pandas was converting my index according the functionality of a different version of matplotlib. 熊猫正在根据不同版本的matplotlib的功能来转换我的索引。 I installed on one server using "easyinstall -U matplotlib" and "pip install -U matplotlib" on the other. 我在另一台服务器上使用“ easyinstall -U matplotlib”和“ pip install -U matplotlib”安装在一台服务器上。

I cannot plot in any of my previous working scripts or in ipython. 我无法在以前的任何工作脚本或ipython中进行绘图。 show() has stopped working in pylab. show()已停止在pylab中工作。 Could someone point me in the direction of what may be broken? 有人可以指出我可能发生的问题吗?

I took the following test script "simple_plot.py" from matplotlib's site and tested it on various servers after first deleting my config directory. 我从matplotlib的站点上获取了以下测试脚本“ simple_plot.py”,并在首次删除配置目录后在各种服务器上对其进行了测试。

from pylab import *
plot([1,2,3])
show()

simple_plot produces a plot on all servers that are running on versions <= 0.99 but has no output on version 1.1. simple_plot在所有运行版本<= 0.99但在版本1.1上没有输出的服务器上生成图。

here is the debug output on one server that does not work: 这是一台不起作用的服务器上的调试输出:

$HOME=/home/michael
CONFIGDIR=/home/michael/.matplotlib
matplotlib data path /usr/local/lib/python2.6/dist-packages/matplotlib-1.1.0-py2.6-linux-x86_64.egg/matplotlib/mpl-data
loaded rc file /usr/local/lib/python2.6/dist-packages/matplotlib-1.1.0-py2.6-linux-x86_64.egg/matplotlib/mpl-data/matplotlibrc
matplotlib version 1.1.0
verbose.level debug
interactive is False
platform is linux2
Using fontManager instance from /home/michael/.matplotlib/fontList.cache
backend agg version v2.2
python version:2.6.5
findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (/usr/local/lib/python2.6/dist-packages/matplotlib-1.1.0-py2.6-linux- x86_64.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 0.000000

You are using the Agg backend, which does not show the figure on the display. 您正在使用Agg后端,该后端未在显示屏上显示该图。 This is the default for matplotlib. 这是matplotlib的默认设置。 You need to change your backend in your matplotlib configuration file (usually ~/.matplotlib/matplotlibrc). 您需要在matplotlib配置文件(通常是〜/ .matplotlib / matplotlibrc)中更改后端。 Look for the part: 寻找零件:

backend      : Agg

And replace 'Agg' with one of: GTKAgg, Qt4Agg, TkAgg, WXAgg. 并将“ Agg”替换为GTKAgg,Qt4Agg,TkAgg,WXAgg中的一种。 You may not have all of these (or any!) installed in your system, so try one that works. 您可能没有在系统中安装所有这些(或任何一个!),所以请尝试一种可行的方法。

If you don't have the file ~/.matplotlib/matplotlibrc, then copy it from your main configuration: 如果您没有〜/ .matplotlib / matplotlibrc文件,请从主配置中复制它:

cp /usr/local/lib/python2.6/dist-packages/matplotlib-1.1.0-py2.6-linux-x86_64.egg/matplotlib/mpl-data/matplotlibrc ~/.matplotlib/matplotlibrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM