0
我有一個熊貓數據框,我正在繪製數據框的兩列之間的散點圖,現在我想將(0,0)的起點轉換爲(1300, 50)在該分散plot.I現在用在Ubuntu使用熊貓python移動劇情的起源
我有一個熊貓數據框,我正在繪製數據框的兩列之間的散點圖,現在我想將(0,0)的起點轉換爲(1300, 50)在該分散plot.I現在用在Ubuntu使用熊貓python移動劇情的起源
Jupyter IPython的筆記本電腦,你可以使用xlim
和ylim
,並提供無論是作爲tuple
或(lower, upper)
的int
,因爲只有下限:
import pandas as pd
import numpy as np
plt.style.use('ggplot')
df = pd.DataFrame(data={'X': np.random.random(100) * 50 + 100, 'Y': np.random.random(100) * 250 + 500})
看起來如:
X Y
count 100.000000 100.000000
mean 126.183239 622.705947
std 15.766365 77.727067
min 100.574628 501.077603
25% 113.219299 545.146821
50% 125.318034 626.237368
75% 141.960502 694.636261
max 149.745984 749.947933
使用
df.plot.scatter('X', 'Y', xlim=(100, 150), ylim=(500, 750))