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





]*>.*?底下插入一個圖檔.*?</w:p>’, flags = re.DOTALL) ; new_xml, n = pattern.subn(”, xml, count=1)' title='Python正則替換:全面掌握 re.sub 與 re.subn 的差異與實戰 #substitute(替換); . 預設匹配「除\n以外的任意單一字元」; pattern = re.compile(r'<w:p[^>]*>.*?底下插入一個圖檔.*?</w:p>’, flags = re.DOTALL) ; new_xml, n = pattern.subn(”, xml, count=1)' loading='lazy' width=350 height=233 />
![Python 如何做excel的樞紐分析? pandas.DataFrame.groupby() ; .agg( {column name: function name} ) ; 如何讀取多層index的xlsx檔案? df = pandas.read_excel (fpath, index_col =[0,1]) ; 如何顯示所有欄? pd.set_option ( “display.max_columns”, None) Python 如何做excel的樞紐分析? pandas.DataFrame.groupby() ; .agg( {column name: function name} ) ; 如何讀取多層index的xlsx檔案? df = pandas.read_excel (fpath, index_col =[0,1]) ; 如何顯示所有欄? pd.set_option ( “display.max_columns”, None)](https://i0.wp.com/savingking.com.tw/wp-content/uploads/2023/03/20230321113121_64.png?quality=90&zoom=2&ssl=1&resize=350%2C233)
![Python TQC 510 費氏數列,list[], f.append(n3) Python TQC 510 費氏數列,list[], f.append(n3)](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2022/04/20220522152013_66.jpg?quality=90&zoom=2&ssl=1&resize=350%2C233)

近期留言