plt.axis([xmin, xmax, ymin, ymax])
![Python: matplotlib繪圖,如何限定座標軸範圍? plt.axis([xmin, xmax, ymin, ymax]) - 儲蓄保險王](https://savingking.com.tw/wp-content/uploads/2023/02/20230208101745_93.jpg)
plt.xlim([xmin, xmax])
plt.ylim([ymin, ymax])
![Python: matplotlib繪圖,如何限定座標軸範圍? plt.axis([xmin, xmax, ymin, ymax]) - 儲蓄保險王](https://savingking.com.tw/wp-content/uploads/2023/02/20230208102115_62.png)
畫Max-mean & Min-mean vs dist的圖
import matplotlib.pyplot as plt
fig,ax = plt.subplots()
ax.plot(dist, max_mean, label=”Max-mean”)
ax.plot(dist, min_mean, label=”Min-mean”)
# lisLim = [dist[0],dist[-1],
# max(max_mean),min(min_mean)]
# plt.axis(lisLim)
ax.legend()
plt.minorticks_on()
ax.grid(visible=True,which=”major”,c=”k”,linewidth=1) ;
ax.grid(visible=True,which=”minor”,c=”k”,linewidth=0.5)
tit = “FF Different Position Max or Min – mean “
ax.set_title(tit)
figpath = os.path.join(figFolder, tit+”.png”)
fig.savefig(figpath)
![Python: matplotlib繪圖,如何限定座標軸範圍? plt.axis([xmin, xmax, ymin, ymax]) - 儲蓄保險王](https://savingking.com.tw/wp-content/uploads/2023/02/20230208102414_59.png)
先看103~105註解掉的情況
(會留buffer)
![Python: matplotlib繪圖,如何限定座標軸範圍? plt.axis([xmin, xmax, ymin, ymax]) - 儲蓄保險王](https://savingking.com.tw/wp-content/uploads/2023/02/20230208102540_48.png)
#新增:
lisLim = [dist[0],dist[-1],
max(max_mean),min(min_mean)]
plt.axis(lisLim)
#無buffer:
![Python: matplotlib繪圖,如何限定座標軸範圍? plt.axis([xmin, xmax, ymin, ymax]) - 儲蓄保險王](https://savingking.com.tw/wp-content/uploads/2023/02/20230208102644_88.png)
推薦hahow線上學習python: https://igrape.net/30afN

![Python爬蟲:BeautifulSoup的 .find_all() 與 .find() 與 .select(‘標籤名[屬性名1=”屬性值1″][屬性名2=”屬性值2″]’) ; from bs4 import BeautifulSoup ; Live Server(可以預覽HTML的VS Code套件) Python爬蟲:BeautifulSoup的 .find_all() 與 .find() 與 .select(‘標籤名[屬性名1=”屬性值1″][屬性名2=”屬性值2″]’) ; from bs4 import BeautifulSoup ; Live Server(可以預覽HTML的VS Code套件)](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2025/03/20250330190318_0_925655.jpg?quality=90&zoom=2&ssl=1&resize=350%2C233)




![Python: pandas.DataFrame 如何對某些欄做格式化字串? apply(); applymap() ; map() 的差別? df[‘Salary’] = df[‘Salary’].map( ‘${:,.2f}’ .format) Python: pandas.DataFrame 如何對某些欄做格式化字串? apply(); applymap() ; map() 的差別? df[‘Salary’] = df[‘Salary’].map( ‘${:,.2f}’ .format)](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2023/05/20230527091636_49.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



近期留言