How does one save python panda scatter_matrix as a figure? -
i have dataframe forms scatter_matrix, can't seem save image. how save it?
import pandas pd my_scatter = pd.scatter_matrix(my_dataframe, diagonal="kde")
how save my_scatter
?
assuming using matplotlib:
import pandas pd import numpy np # necessary example if don't use no poblem import matplotlib.pyplot plt # random data my_dataframe = pd.dataframe(np.random.randn(1000, 4), columns=['a', 'b', 'c', 'd']) # plotting funciton my_scatter = pd.scatter_matrix(my_dataframe, diagonal="kde") # save figure (this can path). stands save in codes directory. plt.savefig(r"figure_1.png")
Comments
Post a Comment