绘制python中的纬度和经度

时间:2017-08-06 06:43:08

标签: python matplotlib

plt.figure(figsize=(8,8))
sns.jointplot(x="latitude",y="longitude",data=prop_df,size=7)
plt.ylabel('longitude')
plt.xlabel('latitude')
plt.show()

此处纬度绘制在x轴上,经度绘制在y轴上,并给出正确的绘图。此数据来自Kaggle Zillow数据集plotted based on the data from the zillow prize challenge

纬度不应位于y轴(水平线),经度不应位于x轴(垂直线) 从它们的定义方式来看,这是显而易见的。 这种差异的原因是什么?

enter image description here

1 个答案:

答案 0 :(得分:0)

不确定确切的问题,但在您要求的问题的代码中 沿x的"latitude"列和y的"longitude"列:

sns.jointplot(x="latitude",y="longitude", data=prop_df)

如果你希望沿y的"latitude"列和x的"longitude"列,你可以在调用jointplot时撤消它们:

sns.jointplot(x="longitude",y="latitude", data=prop_df)

除此之外,结果当然取决于经度"经度。列实际上包含经度作为值,如果没有原始数据则无法验证。

相关问题