Tôi đang vẽ đồ thị phân tán bằng Pandas
. Tôi có thể hiểu cốt truyện, ngoại trừ các đường cong trong các ô đường chéo. Ai đó có thể giải thích cho tôi ý của họ?Hiểu đường chéo trong ô ma trận phân tán của Pandas
Ảnh:
Code:
import pylab
import numpy as np
from pandas.tools.plotting import scatter_matrix
import pandas as pd
def make_scatter_plot(X, name):
"""
Make scatterplot.
Parameters:
-----------
X:a design matrix where each column is a feature and each row is an observation.
name: the name of the plot.
"""
pylab.clf()
df = pd.DataFrame(X)
axs = scatter_matrix(df, alpha=0.2, diagonal='kde')
for ax in axs[:,0]: # the left boundary
ax.grid('off', axis='both')
ax.set_yticks([0, .5])
for ax in axs[-1,:]: # the lower boundary
ax.grid('off', axis='both')
ax.set_xticks([0, .5])
pylab.savefig(name + ".png")
kinda Offtopic và sẽ làm ví dụ ít tập trung, nhưng những lô cầu xin cho thang log-log (ví dụ điển hình do tại sao: http://blogs.sas.com /content/iml/2014/07/09/scatter-plots-with-log-axes.html) –