Plotting 2 data sets with a scatter matrix

时间:2019-01-09 22:29:28

标签: python python-3.x pandas

I can already plot the data from one data frame using pandas.plotting.scatter_matrix, but can you plot 2 data sets that have the same units in the same scatter matrix? changing colors between them to differentiate which data belongs to which data frame?

1 个答案:

答案 0 :(得分:2)

您需要引用Axes对象,以保持在同一子图上绘制。

validates :open_course_id, :uniqueness => { :message => "Already in use", :scope => :mover_id }

Plot

另一个选择是:

import matplotlib.pyplot as plt

x = range(100)
y = range(100,200)
fig = plt.figure()
ax1 = fig.add_subplot(111)

ax1.scatter(x[:4], y[:4], s=10, c='b', marker="s", label='first')
ax1.scatter(x[40:],y[40:], s=10, c='r', marker="o", label='second')
plt.legend(loc='upper left');
plt.show()][1]][1]