我有我的第一次尝试使用matplotlib和scipy来做我的数据的一些散点图(太多变量,试图一次看到许多事情)的一些问题。下面是我的一些代码,工作相当好...麻烦在Matplotlib/Scipy等使用胶乳
import numpy
from scipy import *
import pylab
from matplotlib import *
import h5py
FileID = h5py.File('3DiPVDplot1.mat','r')
# (to view the contents of: list(FileID))
group = FileID['/']
CurrentsArray = group['Currents'].value
IvIIIarray = group['IvIII'].value
PFarray = group['PF'].value
growthTarray = group['growthT'].value
fig = pylab.figure()
ax = fig.add_subplot(111)
cax = ax.scatter(IvIIIarray, growthTarray, PFarray, CurrentsArray, alpha=0.75)
cbar = fig.colorbar(cax)
ax.set_xlabel('Cu/III')
ax.set_ylabel('Growth T')
ax.grid(True)
pylab.show()
我试图修改代码,包括乳胶字体和解释,没有它似乎为我工作,但是。这里有一个例子尝试,没有工作:
import numpy
from scipy import *
import pylab
from matplotlib import *
import h5py
rc('text', usetex=True)
rc('font', family='serif')
FileID = h5py.File('3DiPVDplot1.mat','r')
# (to view the contents of: list(FileID))
group = FileID['/']
CurrentsArray = group['Currents'].value
IvIIIarray = group['IvIII'].value
PFarray = group['PF'].value
growthTarray = group['growthT'].value
fig = pylab.figure()
ax = fig.add_subplot(111)
cax = ax.scatter(IvIIIarray, growthTarray, PFarray, CurrentsArray, alpha=0.75)
cbar = fig.colorbar(cax)
ax.set_xlabel(r'Cu/III')
ax.set_ylabel(r'Growth T')
ax.grid(True)
pylab.show()
我使用Fink安装python26与SciPy的matplotlib等相应的包我一直在使用IPython的和人工的工作,而不是在Python脚本。
由于我对python和scipy完全陌生,所以我确信我正在犯一些愚蠢的简单错误。请赐教!我非常感谢帮助!
史蒂夫!感谢您的评论,我感谢您对此的看法。我正在运行基于--verbose-helpful标志的MacOSX后端(版本未知)。 更多信息 - matplotlib 0.99.0(fink上可用) tzinfo.py提供了一个弃用警告,因为我相信即将发布的py30版本。 – AllenH 2010-05-18 17:56:48
顺便说一句,我应该提到我得到更简单的情节乳胶输出的实例,所以我试图以这种方式追踪它。由于某种原因,上面的代码甚至不会输出正常的散点图 - 所以有些线路正在越过某处 - 我怀疑我使用python/scipy是不正确的。 – AllenH 2010-05-18 17:57:54