久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁技術文章
文章詳情頁

Python figure參數及subplot子圖繪制代碼

瀏覽:37日期:2022-07-29 15:02:03

1. Python的figure參數主要有:

def figure(num=None, # autoincrement if None, else integer from 1-N figsize=None, # defaults to rc figure.figsize dpi=None, # defaults to rc figure.dpi facecolor=None, # defaults to rc figure.facecolor edgecolor=None, # defaults to rc figure.edgecolor frameon=True, FigureClass=Figure, clear=False, **kwargs ):

可以設置圖片大小、分辨率、顏色等。

2. subplot子圖繪制,子圖的繪圖參數可以分別設置

plt.figure(1)x1 = np.linspace(-0.2, 2, 10)y1 = x1**2 + 0.3plt.subplot(121)plt.scatter(x1, y1)plt.xlabel(’X’)plt.ylabel(’Y’)plt.title(’test_1’)x2 = np.linspace(-0.2, 2, 10)y2 = x2 + 0.3plt.subplot(122)plt.plot(x2, y2, color='red', linewidth=1.0, marker = ’s’, linestyle='--')## plt.plot(x, y, color='#ef5492', linewidth=2.0, marker = ’s’, linestyle='--')# plt.plot(x2, y2, ’rs--’) plt.xlabel(’X’)plt.ylabel(’Y’)plt.title(’test_2’)plt.show()

Python figure參數及subplot子圖繪制代碼

3. 在同一張圖片上顯示多種圖形,簡單說把 plt.show()放在最后即可

import matplotlib.pyplot as pltimport numpy as npplt.figure(2)x1 = np.linspace(-0.2, 2, 10)y1 = x1**2 + 0.3plt.scatter(x1, y1)x2 = np.linspace(-0.2, 2, 10)y2 = x2 + 0.3plt.plot(x2, y2, color='red', linewidth=1.0, marker = ’s’, linestyle='--')## plt.plot(x, y, color='#ef5492', linewidth=2.0, marker = ’s’, linestyle='--')# plt.plot(x2, y2, ’rs--’) plt.xlabel(’X’)plt.ylabel(’Y’)plt.title(’test_3’)plt.show()

Python figure參數及subplot子圖繪制代碼

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 山岸逢花在线观看 | 国产精品片aa在线观看 | 欧美日韩在线精品 | 欧美激情精品一区 | 欧美三区 | 在线99 | 欧美福利视频 | chinese中国真实乱对白 | 91精品国产一区二区三区香蕉 | 欧美成人a | 欧美一区二区三区免费电影 | 激情伊人 | 国产高清视频在线 | 东北一级毛片 | 老司机深夜福利在线观看 | 亚洲精品视频在线看 | 成人日韩| 欧美黑人xx| 在线观看亚洲精品 | 一区二区视频 | 亚洲精品一区二区三区蜜桃久 | 黄色天堂在线观看 | 超碰人人99 | 天天精品视频免费观看 | 亚洲欧洲精品成人久久奇米网 | 在线观看中文 | 成人午夜sm精品久久久久久久 | 国产成人精品久久二区二区91 | 亚洲精品一区二区在线观看 | 欧美 亚洲 一区 | 久久毛片 | 欧美在线播放一区二区三区 | www.蜜桃av.com| 亚洲一区成人 | 天堂在线中文 | 北条麻妃一区二区三区在线 | 亚洲色图88 | 久久国产亚洲 | 91国内| 在线观看www| 久久国产精品99久久久久久牛牛 |