2016-06-21 39 views

回答

1

Jupyter IPython的筆記本電腦,你可以使用xlimylim,並提供無論是作爲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)) 

獲得:enter image description here