2013-05-14 104 views

回答

0

你在使用IPython吗?如果你在IPython笔记本中,你有没有试过savefig('/path/to/filename.png')

4

假设你正在使用matplotlib:

import pandas as pd 
import numpy as np # Only necessary for this example if you don't use it no poblem 
import matplotlib.pyplot as plt 

# Random data 
my_dataframe = pd.DataFrame(np.random.randn(1000, 4), columns=['a', 'b', 'c', 'd']) 

# Your plotting funciton 
my_scatter = pd.scatter_matrix(my_dataframe, diagonal="kde") 

# Save the figure (this can also be a path). As it stands now it will save in this codes directory. 
plt.savefig(r"figure_1.png") 
+0

谢谢您的帮助! – gus 2013-06-23 06:48:33