2013-02-05 58 views
1

在MATLAB中,如果需要,可以编辑图形文件(.fig) - 是否有使用pylab的类似功能?用pylab编辑创建的图形

我可以创造我所需要的图像,但它出来作为巴纽我没有在控制 - 如果我能sligthly编辑(如移动传说到一边,或修改标签),将是巨大的

+0

修改颜色'matplotlib.rc(labelcolor ='w')'。 要写它'从matplotlib导入pyplot'然后'pyplot.xlabel('X轴文本')'。 y轴相同。要改变文件的类型,我不知道它是否可能。 –

+0

此刻没有什么像数字文件。但是,如果保存为PDF,应该可以至少使用外部应用程序修改标签。我不知道是否有可能获得类似于你想要的东西[pickle](http://docs.python.org/2/library/pickle.html) –

+0

谢谢你们,有没有一个选项可以另存为.SVG? – Dimitris

回答

0

如果你想保存你的情节,后来编辑它,你应该尝试在这个 thread

给出的提示,如果你的阴谋仍处于[I]蟒蛇壳层活性,可以编辑的所有属性,并重绘。以下示例用于在检查后将图例从默认位置移动到右上角。

In [51]: import numpy as np 

In [52]: import pylab as pl 

In [53]: v = np.arange(10) 

In [54]: pl.figure(1) 
Out[54]: <matplotlib.figure.Figure at 0x253a250> 

In [55]: # if needed, use pl.figure(1) again to make it active 

In [56]: pl.plot(v) 
Out[56]: [<matplotlib.lines.Line2D at 0x456a450>] 

In [60]: pl.legend('v') 
Out[60]: <matplotlib.legend.Legend at 0x4591150> 

In [61]: pl.show(block=False) 

In [62]: # keyword block=False to issue further commands 

In [63]: pl.legend('v',loc=2) 
Out[63]: <matplotlib.legend.Legend at 0x45962d0> 

In [64]: pl.show(block=False) 

In [67]: # now the legend is in the upper right corner 
+0

谢谢 - 这是一个很好的建议,我可以使用 - 但是当我使用block = false关键字时,图像不会出现(我只是试过你的例子) - 我想在编辑它之前看到图像 - 我做错了什么? – Dimitris

+0

你是怎么执行这个脚本的?它应该工作,当你在一个Ipython shell。 – Jan