我正在尝试更新/升级我的NumPy,但我失败了.我想我可能在不同的目录中安装了多个版本的NumPy,但默认情况下python导入旧版本.有帮助吗?
这是我的Python所在的位置:
Gonzo-vs-Kitties:~ brian$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
Run Code Online (Sandbox Code Playgroud)
这是Python导入的版本:
Gonzo-vs-Kitties:~ brian$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> print numpy.__version__
1.5.1
>>>
Run Code Online (Sandbox Code Playgroud)
现在我使用easy_install升级NumPy:
Gonzo-vs-Kitties:~ brian$ sudo easy_install --upgrade numpy
Searching for numpy
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
Reading http://numeric.scipy.org
Best match: numpy 1.6.2
Processing numpy-1.6.2-py2.7-macosx-10.7-intel.egg
numpy 1.6.2 is already the active version in easy-install.pth
Installing f2py …Run Code Online (Sandbox Code Playgroud) 我试图在垂直轴上使用mtext水平读取的标签 ( las=1) 并位于轴的顶部。
我的尝试是使用las=1, adj=1. 当我不指定时,我可以获得所需的位置las=1,但是一旦添加las=1参数,adj=1位置就会消失。这是带有代码的图片。左图显示了正确的位置,但没有las=1. 右图显示了两个参数的存在。
par(mfrow=c(1,2), mar=c(2,3,2,1))
plot(1, 1, ann=F)
mtext(col="blue", "y", side=2, line=2, adj=1)
mtext(side=3, "col=blue, side=2, adj=1")
plot(1, 1, ann=F)
mtext(col="red", "y", side=2, line=2, adj=1, las=1)
mtext(side=3, "col=red, side=2, adj=1, las=1")
Run Code Online (Sandbox Code Playgroud)

我尝试过使用 padj,但这只会使标签上下移动一点。另外,我知道这个at论点可以,但这感觉有点太手动了。